钱智,社保报表
This commit is contained in:
parent
fe02f57215
commit
a85e371791
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.siaccount.dto.QZReportListDTO;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
|
||||
|
||||
|
|
@ -19,4 +20,6 @@ public interface RecordsBuildService {
|
|||
List<Map<String, Object>> buildCommonRecordsWithStyle(List<InsuranceAccountDetailPO> list, Long employeeId);
|
||||
|
||||
List<Map<String, Object>> buildInspectRecords(List<InsuranceAccountInspectPO> list, Long paymentOrganization);
|
||||
|
||||
List<Map<String, Object>> buildQzReport(List<QZReportListDTO> list, Long employeeId, boolean dynamicEmpInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.siaccount.dto.QZReportListDTO;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO;
|
||||
|
|
@ -28,11 +29,13 @@ import com.engine.salary.util.SalaryEnumUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
|
|
@ -47,6 +50,7 @@ import java.util.stream.Collectors;
|
|||
* @Date 2022/4/11
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class RecordsBuildServiceImpl extends Service implements RecordsBuildService {
|
||||
|
||||
private EmployMapper getEmployMapper() {
|
||||
|
|
@ -150,7 +154,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
if (socialComJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
socialComJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "socialComBase", v);
|
||||
|
|
@ -170,7 +174,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
}
|
||||
}
|
||||
}
|
||||
record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName());
|
||||
record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(), TaxAgentPO.builder().build())).getName());
|
||||
record.put("fundAccount", item.getFundAccount());
|
||||
record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId()));
|
||||
record.put("supplementFundAccount", item.getSupplementFundAccount());
|
||||
|
|
@ -185,7 +189,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
if (fundJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
fundJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "fundPerBase", v);
|
||||
|
|
@ -197,7 +201,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
if (fundComJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
fundComJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "fundComBase", v);
|
||||
|
|
@ -217,7 +221,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
}
|
||||
}
|
||||
}
|
||||
record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName());
|
||||
record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(), TaxAgentPO.builder().build())).getName());
|
||||
record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId()));
|
||||
if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) {
|
||||
Map<String, Object> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
|
||||
|
|
@ -230,7 +234,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
if (otherJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
otherJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "otherPerBase", v);
|
||||
|
|
@ -242,7 +246,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
if (otherComJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
otherComJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "otherComBase", v);
|
||||
|
|
@ -264,7 +268,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
}
|
||||
if (StringUtils.isNotEmpty(item.getSocialPerJson())) {
|
||||
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, Object>().getClass());
|
||||
if(socialJson!=null){
|
||||
if (socialJson != null) {
|
||||
socialJson.forEach((k, v) -> {
|
||||
record.put(k + "socialPer", (String) v);
|
||||
});
|
||||
|
|
@ -297,7 +301,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
// record.put("socialSpecialSum", socialSpecialSum[0]);
|
||||
if (StringUtils.isNotEmpty(item.getFundPerJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, Object>().getClass());
|
||||
if(fundPerJson!=null){
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "fundPer", (String) v);
|
||||
});
|
||||
|
|
@ -329,7 +333,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
// record.put("fundSpecialSum", fundSpecialSum[0]);
|
||||
if (StringUtils.isNotEmpty(item.getOtherPerJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, Object>().getClass());
|
||||
if(fundPerJson!=null){
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "otherPer", (String) v);
|
||||
});
|
||||
|
|
@ -340,7 +344,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
record.put("perSum", item.getPerSum());
|
||||
if (StringUtils.isNotEmpty(item.getSocialComJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, Object>().getClass());
|
||||
if(fundPerJson!=null){
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "socialCom", (String) v);
|
||||
});
|
||||
|
|
@ -352,7 +356,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
record.put("socialComSum", item.getSocialComSum());
|
||||
if (StringUtils.isNotEmpty(item.getFundComJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, Object>().getClass());
|
||||
if(fundPerJson!=null){
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "fundCom", (String) v);
|
||||
});
|
||||
|
|
@ -362,7 +366,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
record.put("fundComSum", item.getFundComSum());
|
||||
if (StringUtils.isNotEmpty(item.getOtherComJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, Object>().getClass());
|
||||
if(fundPerJson!=null){
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "otherCom", (String) v);
|
||||
});
|
||||
|
|
@ -375,7 +379,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
final BigDecimal[] socialSpecialSum = {new BigDecimal(0)};
|
||||
if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) {
|
||||
Map<String, Object> socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap<String, Object>().getClass());
|
||||
if(socialSpecialJson!=null){
|
||||
if (socialSpecialJson != null) {
|
||||
socialSpecialJson.forEach((k, v) -> {
|
||||
// String standardSocialPer = Util.null2String(record.get(k + "socialPer"));
|
||||
// BigDecimal standardSocialPerVal = new BigDecimal(0);
|
||||
|
|
@ -399,7 +403,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
final BigDecimal[] fundSpecialSum = {new BigDecimal(0)};
|
||||
if (StringUtils.isNotEmpty(item.getFundSpecialJson())) {
|
||||
Map<String, Object> fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap<String, Object>().getClass());
|
||||
if(fundSpecialJson!=null){
|
||||
if (fundSpecialJson != null) {
|
||||
fundSpecialJson.forEach((k, v) -> {
|
||||
// String standardFundPer = Util.null2String(record.get(k + "fundPer"));
|
||||
// BigDecimal standardFundPerVal = new BigDecimal(0);
|
||||
|
|
@ -515,4 +519,388 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
|
|||
}
|
||||
return new SimpleDateFormat(SalaryI18nUtil.getI18nLabel(100519, "补缴yyyy年MM月")).format(date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> buildQzReport(List<QZReportListDTO> list, Long employeeId, boolean dynamicEmpInfo) {
|
||||
boolean welBaseDiffSign = getSIArchivesService(user).isDiffWelBase();
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return result;
|
||||
}
|
||||
List<Long> employeeIds = list.stream().map(item -> item.getEmployeeId()).distinct().collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeByIds = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
|
||||
for (List<Long> longs : partition) {
|
||||
employeeByIds.addAll(getSalaryEmployeeService(user).getEmployeeByIdsAll(longs));
|
||||
}
|
||||
if (CollectionUtils.isEmpty(employeeByIds)) {
|
||||
return result;
|
||||
}
|
||||
List<TaxAgentPO> paymentList = getTaxAgentMapper().listAll();
|
||||
|
||||
SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "暂无扣缴义务人"));
|
||||
Map<Long, TaxAgentPO> paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity()));
|
||||
Map<Long, DataCollectionEmployee> collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity()));
|
||||
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
||||
list.forEach(item -> {
|
||||
Map<String, Object> record = new HashMap<>();
|
||||
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId());
|
||||
record.put("id", item.getId());
|
||||
record.put("paymentOrganizationName", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName());
|
||||
record.put("workcode", StringUtils.isBlank(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode());
|
||||
record.put("userName", simpleEmployee.getUsername());
|
||||
String[] depList = new String[0];
|
||||
try {
|
||||
depList = departmentComInfo.getDepartmentRealPath(simpleEmployee.getDepartmentId().toString(), ",", "").split(",");
|
||||
} catch (Exception ex) {
|
||||
log.error("获取部门信息失败" + simpleEmployee.getDepartmentId() + ex);
|
||||
depList = new String[0];
|
||||
}
|
||||
record.put("firstDepartmentName", depList.length >= 1 ? Util.formatMultiLang(depList[depList.length - 1], String.valueOf(user.getLanguage())) : "");
|
||||
record.put("secondDepartmentName", depList.length >= 2 ? Util.formatMultiLang(depList[depList.length - 2], String.valueOf(user.getLanguage())) : "");
|
||||
record.put("jobcall", item.getJobcall());
|
||||
record.put("companystartdate", simpleEmployee.getCompanystartdate());
|
||||
record.put("dismissdate", item.getStatus() != null && UserStatusEnum.getUnavailableStatus().contains(item.getStatus()) ? simpleEmployee.getDismissdate() : "");
|
||||
//社保基数,取养老个人的基数
|
||||
|
||||
|
||||
if (!dynamicEmpInfo) {
|
||||
record.put("department", item.getDepartmentName());
|
||||
record.put("departmentId", item.getDepartmentId());
|
||||
record.put("subcompany", item.getSubcompanyName());
|
||||
record.put("subcompanyId", item.getSubcompanyId());
|
||||
record.put("jobtitle", item.getJobtitleName());
|
||||
record.put("jobtitleId", item.getJobtitleId());
|
||||
record.put("jobcall", item.getJobcall());
|
||||
record.put("jobcallId", item.getJobcallId());
|
||||
record.put("employeeStatus", item.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(item.getStatus())) : "");
|
||||
} else {
|
||||
record.put("department", simpleEmployee.getDepartmentName());
|
||||
record.put("departmentId", simpleEmployee.getDepartmentId());
|
||||
record.put("employeeStatus", simpleEmployee.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(simpleEmployee.getStatus())) : "");
|
||||
}
|
||||
|
||||
record.put("supplementaryMonth", item.getSupplementaryMonth());
|
||||
ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class);
|
||||
|
||||
record.put("idNo", Util.null2String(simpleEmployee.getIdNo()));
|
||||
record.put("sourceFrom", SalaryI18nUtil.getI18nLabel(from.getLabelId(), from.getDefaultLabel()));
|
||||
record.put("socialPayOrg", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName());
|
||||
record.put("socialAccount", item.getSocialAccount());
|
||||
|
||||
record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId()));
|
||||
if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString()) || StringUtils.isNotEmpty(item.getSocialPaymentComBaseString())) {
|
||||
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap<String, Object>().getClass());
|
||||
// if(socialJson!=null){
|
||||
// socialJson.forEach((k, v) -> {
|
||||
// record.put(k + "socialBase", (String) v);
|
||||
// });
|
||||
// }
|
||||
if (welBaseDiffSign) {
|
||||
if (socialJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
socialJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "socialPerBase", v);
|
||||
}
|
||||
if (Long.parseLong(k) == 9001L) {
|
||||
record.put("socialBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
Map<String, Object> socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (socialComJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
socialComJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "socialComBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (socialJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getSocialSchemeId());
|
||||
socialJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "socialBase", v);
|
||||
}
|
||||
if (Long.parseLong(k) == 9001L) {
|
||||
record.put("socialBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(), TaxAgentPO.builder().build())).getName());
|
||||
record.put("fundAccount", item.getFundAccount());
|
||||
record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId()));
|
||||
record.put("supplementFundAccount", item.getSupplementFundAccount());
|
||||
if (StringUtils.isNotEmpty(item.getFundPaymentBaseString()) || StringUtils.isNotEmpty(item.getFundPaymentComBaseString())) {
|
||||
Map<String, Object> fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap<String, Object>().getClass());
|
||||
// if(fundJson!=null){
|
||||
// fundJson.forEach((k, v) -> {
|
||||
// record.put(k + "fundBase", (String) v);
|
||||
// });
|
||||
// }
|
||||
if (welBaseDiffSign) {
|
||||
if (fundJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
fundJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "fundPerBase", v);
|
||||
}
|
||||
if (Long.parseLong(k) == 9006L) {
|
||||
record.put("fundBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
Map<String, Object> fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (fundComJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
fundComJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "fundComBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (fundJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getFundSchemeId());
|
||||
fundJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "fundBase", v);
|
||||
}
|
||||
if (Long.parseLong(k) == 9006L) {
|
||||
record.put("fundBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(), TaxAgentPO.builder().build())).getName());
|
||||
record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId()));
|
||||
if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) {
|
||||
Map<String, Object> otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap<String, Object>().getClass());
|
||||
// if(otherJson!=null){
|
||||
// otherJson.forEach((k, v) -> {
|
||||
// record.put(k + "otherBase", (String) v);
|
||||
// });
|
||||
// }
|
||||
if (welBaseDiffSign) {
|
||||
if (otherJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
otherJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "otherPerBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
Map<String, Object> otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
if (otherComJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
otherComJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "otherComBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (otherJson != null) {
|
||||
//查询该福利方案下开启缴纳的福利项
|
||||
// List<Long> insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId());
|
||||
List<Long> insuranceIdList = getSIArchivesService(user).payInsuranceIds(item.getOtherSchemeId());
|
||||
otherJson.forEach((k, v) -> {
|
||||
if (insuranceIdList.contains(Long.valueOf(k))) {
|
||||
record.put(k + "otherBase", v);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(item.getSocialPerJson())) {
|
||||
Map<String, Object> socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap<String, Object>().getClass());
|
||||
if (socialJson != null) {
|
||||
socialJson.forEach((k, v) -> {
|
||||
record.put(k + "socialPer", (String) v);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// // 钱智 社保差异
|
||||
// final BigDecimal[] socialSpecialSum = {new BigDecimal(0)};
|
||||
// if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) {
|
||||
// Map<String, Object> socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap<String, Object>().getClass());
|
||||
// if(socialSpecialJson!=null){
|
||||
// socialSpecialJson.forEach((k, v) -> {
|
||||
// String standardSocialPer = Util.null2String(record.get(k + "socialPer"));
|
||||
// BigDecimal standardSocialPerVal = new BigDecimal(0);
|
||||
// BigDecimal specialSocialPerVal = new BigDecimal(0);
|
||||
// if (NumberUtils.isCreatable(standardSocialPer)) {
|
||||
// standardSocialPerVal = new BigDecimal(standardSocialPer);
|
||||
// }
|
||||
// if (v != null && NumberUtils.isCreatable(v.toString())) {
|
||||
// specialSocialPerVal = new BigDecimal(v.toString());
|
||||
// }
|
||||
// BigDecimal subtract = specialSocialPerVal.subtract(standardSocialPerVal);
|
||||
// socialSpecialSum[0] = socialSpecialSum[0].add(subtract);
|
||||
// record.put(k + "socialSpecial", subtract.toString());
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
record.put("socialPerSum", item.getSocialPerSum());
|
||||
// record.put("socialSpecialSum", socialSpecialSum[0]);
|
||||
if (StringUtils.isNotEmpty(item.getFundPerJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap<String, Object>().getClass());
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "fundPer", (String) v);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
// // 钱智 公积金差异
|
||||
// final BigDecimal[] fundSpecialSum = {new BigDecimal(0)};
|
||||
// if (StringUtils.isNotEmpty(item.getFundSpecialJson())) {
|
||||
// Map<String, Object> fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap<String, Object>().getClass());
|
||||
// if(fundSpecialJson!=null){
|
||||
// fundSpecialJson.forEach((k, v) -> {
|
||||
// String standardFundPer = Util.null2String(record.get(k + "fundPer"));
|
||||
// BigDecimal standardFundPerVal = new BigDecimal(0);
|
||||
// BigDecimal specialFundPerVal = new BigDecimal(0);
|
||||
// if (NumberUtils.isCreatable(standardFundPer)) {
|
||||
// standardFundPerVal = new BigDecimal(standardFundPer);
|
||||
// }
|
||||
// if (v != null && NumberUtils.isCreatable(v.toString())) {
|
||||
// specialFundPerVal = new BigDecimal(v.toString());
|
||||
// }
|
||||
// BigDecimal subtract = specialFundPerVal.subtract(standardFundPerVal);
|
||||
// fundSpecialSum[0] = fundSpecialSum[0].add(subtract);
|
||||
// record.put(k + "fundSpecial", subtract.toString());
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
record.put("fundPerSum", item.getFundPerSum());
|
||||
// record.put("fundSpecialSum", fundSpecialSum[0]);
|
||||
if (StringUtils.isNotEmpty(item.getOtherPerJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap<String, Object>().getClass());
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "otherPer", (String) v);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
record.put("otherPerSum", item.getOtherPerSum());
|
||||
record.put("perSum", item.getPerSum());
|
||||
if (StringUtils.isNotEmpty(item.getSocialComJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getSocialComJson(), new HashMap<String, Object>().getClass());
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "socialCom", (String) v);
|
||||
});
|
||||
}
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "socialCom", (String) v);
|
||||
});
|
||||
}
|
||||
record.put("socialComSum", item.getSocialComSum());
|
||||
if (StringUtils.isNotEmpty(item.getFundComJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getFundComJson(), new HashMap<String, Object>().getClass());
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "fundCom", (String) v);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
record.put("fundComSum", item.getFundComSum());
|
||||
if (StringUtils.isNotEmpty(item.getOtherComJson())) {
|
||||
Map<String, Object> fundPerJson = JSON.parseObject(item.getOtherComJson(), new HashMap<String, Object>().getClass());
|
||||
if (fundPerJson != null) {
|
||||
fundPerJson.forEach((k, v) -> {
|
||||
record.put(k + "otherCom", (String) v);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
record.put("otherComSum", item.getOtherComSum());
|
||||
|
||||
// 钱智 社保差异
|
||||
final BigDecimal[] socialSpecialSum = {new BigDecimal(0)};
|
||||
if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) {
|
||||
Map<String, Object> socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap<String, Object>().getClass());
|
||||
if (socialSpecialJson != null) {
|
||||
socialSpecialJson.forEach((k, v) -> {
|
||||
// String standardSocialPer = Util.null2String(record.get(k + "socialPer"));
|
||||
// BigDecimal standardSocialPerVal = new BigDecimal(0);
|
||||
// if (NumberUtils.isCreatable(standardSocialPer)) {
|
||||
// standardSocialPerVal = new BigDecimal(standardSocialPer);
|
||||
// }
|
||||
BigDecimal specialComVal = v == null ? new BigDecimal("0") : new BigDecimal(v.toString());
|
||||
String standardSocialCom = Util.null2String(record.get(k + "socialCom"));
|
||||
BigDecimal standardComPerVal = new BigDecimal(0);
|
||||
if (NumberUtils.isCreatable(standardSocialCom)) {
|
||||
standardComPerVal = new BigDecimal(standardSocialCom);
|
||||
}
|
||||
BigDecimal subtract = specialComVal.subtract(standardComPerVal);
|
||||
socialSpecialSum[0] = socialSpecialSum[0].add(subtract);
|
||||
record.put(k + "socialSpecial", subtract.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
record.put("socialSpecialSum", socialSpecialSum[0].toPlainString());
|
||||
// 钱智 公积金差异
|
||||
final BigDecimal[] fundSpecialSum = {new BigDecimal(0)};
|
||||
if (StringUtils.isNotEmpty(item.getFundSpecialJson())) {
|
||||
Map<String, Object> fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap<String, Object>().getClass());
|
||||
if (fundSpecialJson != null) {
|
||||
fundSpecialJson.forEach((k, v) -> {
|
||||
// String standardFundPer = Util.null2String(record.get(k + "fundPer"));
|
||||
// BigDecimal standardFundPerVal = new BigDecimal(0);
|
||||
// if (NumberUtils.isCreatable(standardFundPer)) {
|
||||
// standardFundPerVal = new BigDecimal(standardFundPer);
|
||||
// }
|
||||
BigDecimal specialComVal = v == null ? new BigDecimal("0") : new BigDecimal(v.toString());
|
||||
String standardFundCom = Util.null2String(record.get(k + "fundCom"));
|
||||
BigDecimal standardFundComVal = new BigDecimal(0);
|
||||
if (NumberUtils.isCreatable(standardFundCom)) {
|
||||
standardFundComVal = new BigDecimal(standardFundCom);
|
||||
}
|
||||
BigDecimal subtract = specialComVal.subtract(standardFundComVal);
|
||||
fundSpecialSum[0] = fundSpecialSum[0].add(subtract);
|
||||
record.put(k + "fundSpecial", subtract.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
record.put("fundSpecialSum", fundSpecialSum[0].toPlainString());
|
||||
record.put("specialSum", socialSpecialSum[0].add(fundSpecialSum[0]).toPlainString());
|
||||
record.put("comSum", item.getComSum());
|
||||
record.put("socialSum", item.getSocialSum());
|
||||
record.put("fundSum", item.getFundSum());
|
||||
record.put("otherSum", item.getOtherSum());
|
||||
record.put("total", item.getTotal());
|
||||
result.add(record);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -7209,9 +7209,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
//系统人员福利台账明细
|
||||
list.addAll(encryptUtil.decryptList(getInsuranceAccountDetailMapper().qzReportList(queryParam), QZReportListDTO.class));
|
||||
List<QZReportListDTO> qzReportListDTOS = getInsuranceAccountDetailMapper().qzReportList(queryParam);
|
||||
encryptUtil.decryptList(qzReportListDTOS, QZReportListDTO.class);
|
||||
list.addAll(qzReportListDTOS);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> list1 = getService(user).buildQzReport(list, (long) user.getUID(), false);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue