Compare commits

...

2 Commits

Author SHA1 Message Date
钱涛 a85e371791 钱智,社保报表 2025-11-26 16:45:01 +08:00
钱涛 fe02f57215 钱智,社保报表 2025-11-25 16:13:40 +08:00
9 changed files with 1256 additions and 15 deletions

View File

@ -0,0 +1,584 @@
package com.engine.salary.entity.siaccount.dto;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.annotation.Encrypt;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class QZReportListDTO {
/**
* 公司名称
*/
@ElogTransform(name = "个税扣缴义务人")
private Long paymentOrganization;
private String paymentOrganizationName;
/**
* 工号
*/
private String workCode;
/**
* 一级部门
*/
private String dept1;
/**
* 二级部门
*/
private String dept2;
/**
* 实际工作地
*/
private String actualWorkplace;
/**
* 劳动关系地
*/
private String laborWorkplace;
/**
* 岗位名称
*/
private String jobcall;
/**
* 进入日期
*/
/**
* 离职日期
*/
/**
* 社保基数
*/
private String socialBase;
/**
* 公积金基数
*/
private String fundBase;
/**
* 主键id
*/
@ElogTransform(name = "主键id")
private Long id;
/**
* 员工id
*/
@ElogTransform(name = "员工id")
private Long employeeId;
/**
* 账单月份
*/
@ElogTransform(name = "账单月份")
private String billMonth;
/**
* 账单状态 0-未归档 1-已归档
*/
@ElogTransform(name = "账单状态")
private Integer billStatus;
/**
* 缴纳状态
*/
@ElogTransform(name = "缴纳状态")
private Integer paymentStatus;
/**
* 补缴月份/退差月份
*/
@ElogTransform(name = "补缴月份/退差月份")
private String supplementaryMonth;
/**
* 补缴项目
*/
@ElogTransform(name = "补缴项目")
private String supplementaryProjects;
/**
* 数据来源 0-系统核算 1-临时数据
*/
@ElogTransform(name = "数据来源")
private Integer resourceFrom;
/**
* 社保缴纳组织
*/
@ElogTransform(name = "社保缴纳组织")
private Long socialPayOrg;
/**
* 社保账号
*/
@ElogTransform(name = "社保账号")
private String socialAccount;
/**
* 公积金缴纳组织
*/
@ElogTransform(name = "公积金缴纳组织")
private Long fundPayOrg;
/**
* 公积金账号
*/
@ElogTransform(name = "公积金账号")
private String fundAccount;
/**
* 补充公积金账号
*/
@ElogTransform(name = "补充公积金账号")
private String supplementFundAccount;
/**
* 其他福利缴纳组织
*/
@ElogTransform(name = "其他福利缴纳组织")
private Long otherPayOrg;
/**
* 社保方案ID
*/
@ElogTransform(name = "社保方案ID")
private Long socialSchemeId;
/**
* 社保缴纳基数
*/
@Encrypt
@ElogTransform(name = "社保缴纳基数")
private String socialPaymentBaseString;
/**
* 社保缴纳基数单位
*/
@Encrypt
@ElogTransform(name = "社保缴纳基数——单位")
private String socialPaymentComBaseString;
/**
* 公积金方案ID
*/
@ElogTransform(name = "公积金方案ID")
private Long fundSchemeId;
/**
* 公积金缴纳基数
*/
@Encrypt
@ElogTransform(name = "公积金缴纳基数")
private String fundPaymentBaseString;
/**
* 公积金缴纳基数单位
*/
@Encrypt
@ElogTransform(name = "公积金缴纳基数——单位")
private String fundPaymentComBaseString;
/**
* 其他福利方案id
*/
@ElogTransform(name = "其他福利方案id")
private Long otherSchemeId;
/**
* 其他福利缴纳基数
*/
@Encrypt
@ElogTransform(name = "其他福利缴纳基数")
private String otherPaymentBaseString;
/**
* 其他福利缴纳基数单位
*/
@Encrypt
@ElogTransform(name = "其他福利缴纳基数——单位")
private String otherPaymentComBaseString;
/**
* 社保个人缴费明细
*/
@Encrypt
@ElogTransform(name = "社保个人缴费明细")
private String socialPerJson;
/**
* 特殊社保缴费明细
*/
@Encrypt
@ElogTransform(name = "特殊社保缴费明细")
private String socialSpecialJson;
/**
* 社保个人合计
*/
@Encrypt
@ElogTransform(name = "社保个人合计")
private String socialPerSum;
/**
* 公积金个人缴费明细
*/
@Encrypt
@ElogTransform(name = "公积金个人缴费明细")
private String fundPerJson;
/**
* 特殊公积金缴费明细
*/
@Encrypt
@ElogTransform(name = "特殊公积金缴费明细")
private String fundSpecialJson;
/**
* 公积金个人合计
*/
@Encrypt
@ElogTransform(name = "公积金个人合计")
private String fundPerSum;
/**
* 其他福利个人缴费明细
*/
@Encrypt
@ElogTransform(name = "其他福利个人缴费明细")
private String otherPerJson;
/**
* 其他福利个人合计
*/
@Encrypt
@ElogTransform(name = "其他福利个人合计")
private String otherPerSum;
/**
* 个人合计
*/
@Encrypt
@ElogTransform(name = "个人合计")
private String perSum;
/**
* 社保单位缴费明细
*/
@Encrypt
@ElogTransform(name = "社保单位缴费明细")
private String socialComJson;
/**
* 社保单位合计
*/
@Encrypt
@ElogTransform(name = "社保单位合计")
private String socialComSum;
/**
* 公积金单位缴费明细
*/
@ElogTransform(name = "公积金单位缴费明细")
private String fundComJson;
/**
* 公积金单位合计
*/
@ElogTransform(name = "公积金单位合计")
private String fundComSum;
/**
* 其他福利单位缴费明细
*/
@ElogTransform(name = "其他福利单位缴费明细")
private String otherComJson;
/**
* 其他福利单位合计
*/
@ElogTransform(name = "其他福利单位合计")
private String otherComSum;
/**
* 单位合计
*/
@Encrypt
@ElogTransform(name = "单位合计")
private String comSum;
/**
* 社保合计
*/
@Encrypt
@ElogTransform(name = "社保合计")
private String socialSum;
/**
* 公积金合计
*/
@Encrypt
@ElogTransform(name = "公积金合计")
private String fundSum;
/**
* 其他福利合计
*/
@Encrypt
@ElogTransform(name = "其他福利合计")
private String otherSum;
/**
* 合计
*/
@Encrypt
@ElogTransform(name = "合计")
private String total;
private String subcompanyName;
private Long subcompanyId;
private String departmentName;
private Long departmentId;
private String jobtitleName;
private Long jobtitleId;
private Long jobcallId;
private String status;
/**
* 社保方案ID
*/
@ElogTransform(name = "社保方案ID")
private Long bSocialSchemeId;
/**
* 社保缴纳基数
*/
@Encrypt
@ElogTransform(name = "社保缴纳基数")
private String bSocialPaymentBaseString;
/**
* 社保缴纳基数单位
*/
@Encrypt
@ElogTransform(name = "社保缴纳基数——单位")
private String bSocialPaymentComBaseString;
/**
* 公积金方案ID
*/
@ElogTransform(name = "公积金方案ID")
private Long bFundSchemeId;
/**
* 公积金缴纳基数
*/
@Encrypt
@ElogTransform(name = "公积金缴纳基数")
private String bFundPaymentBaseString;
/**
* 公积金缴纳基数单位
*/
@Encrypt
@ElogTransform(name = "公积金缴纳基数——单位")
private String bFundPaymentComBaseString;
/**
* 其他福利方案id
*/
@ElogTransform(name = "其他福利方案id")
private Long bOtherSchemeId;
/**
* 其他福利缴纳基数
*/
@Encrypt
@ElogTransform(name = "其他福利缴纳基数")
private String bOtherPaymentBaseString;
/**
* 其他福利缴纳基数单位
*/
@Encrypt
@ElogTransform(name = "其他福利缴纳基数——单位")
private String bOtherPaymentComBaseString;
/**
* 社保个人缴费明细
*/
@Encrypt
@ElogTransform(name = "社保个人缴费明细")
private String bSocialPerJson;
/**
* 特殊社保缴费明细
*/
@Encrypt
@ElogTransform(name = "特殊社保缴费明细")
private String bSocialSpecialJson;
/**
* 社保个人合计
*/
@Encrypt
@ElogTransform(name = "社保个人合计")
private String bSocialPerSum;
/**
* 公积金个人缴费明细
*/
@Encrypt
@ElogTransform(name = "公积金个人缴费明细")
private String bFundPerJson;
/**
* 特殊公积金缴费明细
*/
@Encrypt
@ElogTransform(name = "特殊公积金缴费明细")
private String bFundSpecialJson;
/**
* 公积金个人合计
*/
@Encrypt
@ElogTransform(name = "公积金个人合计")
private String bFundPerSum;
/**
* 其他福利个人缴费明细
*/
@Encrypt
@ElogTransform(name = "其他福利个人缴费明细")
private String bOtherPerJson;
/**
* 其他福利个人合计
*/
@Encrypt
@ElogTransform(name = "其他福利个人合计")
private String bOtherPerSum;
/**
* 个人合计
*/
@Encrypt
@ElogTransform(name = "个人合计")
private String bPerSum;
/**
* 社保单位缴费明细
*/
@Encrypt
@ElogTransform(name = "社保单位缴费明细")
private String bSocialComJson;
/**
* 社保单位合计
*/
@Encrypt
@ElogTransform(name = "社保单位合计")
private String bSocialComSum;
/**
* 公积金单位缴费明细
*/
@ElogTransform(name = "公积金单位缴费明细")
private String bFundComJson;
/**
* 公积金单位合计
*/
@ElogTransform(name = "公积金单位合计")
private String bFundComSum;
/**
* 其他福利单位缴费明细
*/
@ElogTransform(name = "其他福利单位缴费明细")
private String bOtherComJson;
/**
* 其他福利单位合计
*/
@ElogTransform(name = "其他福利单位合计")
private String bOtherComSum;
/**
* 单位合计
*/
@Encrypt
@ElogTransform(name = "单位合计")
private String bComSum;
/**
* 社保合计
*/
@Encrypt
@ElogTransform(name = "社保合计")
private String bSocialSum;
/**
* 公积金合计
*/
@Encrypt
@ElogTransform(name = "公积金合计")
private String bFundSum;
/**
* 其他福利合计
*/
@Encrypt
@ElogTransform(name = "其他福利合计")
private String bOtherSum;
/**
* 合计
*/
@Encrypt
@ElogTransform(name = "合计")
private String bTotal;
}

View File

@ -0,0 +1,26 @@
package com.engine.salary.entity.siaccount.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 钱智社保报表
* <p>Copyright: Copyright (c) 2025</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class QZInsuranceAccountBatchParam {
private List<Long> ids;
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.siaccount.dto.QZReportListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
@ -200,4 +201,6 @@ public interface InsuranceAccountDetailMapper {
void deleteByIds(@Param("ids")List<Long> ids);
void deleteByEmpIds(@Param("employeeIds")List<Long> deleteEmployeeIds, @Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
List<QZReportListDTO> qzReportList(InsuranceAccountDetailParam queryParam);
}

View File

@ -1636,4 +1636,191 @@
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
</select>
<resultMap id="qzReportListMap" type="com.engine.salary.entity.siaccount.dto.QZReportListDTO">
<result column="id" property="id"/>
<result column="payment_organization" property="paymentOrganization"/>
<result column="employee_id" property="employeeId"/>
<result column="bill_month" property="billMonth"/>
<result column="bill_status" property="billStatus"/>
<result column="payment_status" property="paymentStatus"/>
<result column="supplementary_month" property="supplementaryMonth"/>
<result column="supplementary_projects" property="supplementaryProjects"/>
<result column="resource_from" property="resourceFrom"/>
<result column="social_pay_org" property="socialPayOrg"/>
<result column="social_account" property="socialAccount"/>
<result column="fund_pay_org" property="fundPayOrg"/>
<result column="fund_account" property="fundAccount"/>
<result column="supplement_fund_account" property="supplementFundAccount"/>
<result column="other_pay_org" property="otherPayOrg"/>
<result column="subcompany_name" property="subcompanyName"/>
<result column="subcompany_id" property="subcompanyId"/>
<result column="department_name" property="departmentName"/>
<result column="department_id" property="departmentId"/>
<result column="jobtitle_name" property="jobtitleName"/>
<result column="jobtitle_id" property="jobtitleId"/>
<result column="jobcall" property="jobcall"/>
<result column="jobcall_id" property="jobcallId"/>
<result column="status" property="status"/>
<result column="social_scheme_id" property="socialSchemeId"/>
<result column="social_payment_base_string" property="socialPaymentBaseString"/>
<result column="social_payment_com_base_string" property="socialPaymentComBaseString"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<result column="fund_payment_com_base_string" property="fundPaymentComBaseString"/>
<result column="other_scheme_id" property="otherSchemeId"/>
<result column="other_payment_base_string" property="otherPaymentBaseString"/>
<result column="other_payment_com_base_string" property="otherPaymentComBaseString"/>
<result column="social_per_json" property="socialPerJson"/>
<result column="social_per_sum" property="socialPerSum"/>
<result column="fund_per_json" property="fundPerJson"/>
<result column="fund_per_sum" property="fundPerSum"/>
<result column="other_per_json" property="otherPerJson"/>
<result column="other_per_sum" property="otherPerSum"/>
<result column="per_sum" property="perSum"/>
<result column="social_com_json" property="socialComJson"/>
<result column="social_com_sum" property="socialComSum"/>
<result column="fund_com_json" property="fundComJson"/>
<result column="fund_com_sum" property="fundComSum"/>
<result column="other_com_json" property="otherComJson"/>
<result column="other_com_sum" property="otherComSum"/>
<result column="com_sum" property="comSum"/>
<result column="social_sum" property="socialSum"/>
<result column="fund_sum" property="fundSum"/>
<result column="other_sum" property="otherSum"/>
<result column="total" property="total"/>
<result column="social_special_json" property="socialSpecialJson"/>
<result column="fund_special_json" property="fundSpecialJson"/>
<result column="b_social_scheme_id" property="bSocialSchemeId"/>
<result column="b_social_payment_base_string" property="bSocialPaymentBaseString"/>
<result column="b_social_payment_com_base_string" property="bSocialPaymentComBaseString"/>
<result column="b_fund_scheme_id" property="bFundSchemeId"/>
<result column="b_fund_payment_base_string" property="bFundPaymentBaseString"/>
<result column="b_fund_payment_com_base_string" property="bFundPaymentComBaseString"/>
<result column="b_other_scheme_id" property="bOtherSchemeId"/>
<result column="b_other_payment_base_string" property="bOtherPaymentBaseString"/>
<result column="b_other_payment_com_base_string" property="bOtherPaymentComBaseString"/>
<result column="b_social_per_json" property="bSocialPerJson"/>
<result column="b_social_per_sum" property="bSocialPerSum"/>
<result column="b_fund_per_json" property="bFundPerJson"/>
<result column="b_fund_per_sum" property="bFundPerSum"/>
<result column="b_other_per_json" property="bOtherPerJson"/>
<result column="b_other_per_sum" property="bOtherPerSum"/>
<result column="b_per_sum" property="bPerSum"/>
<result column="b_social_com_json" property="bSocialComJson"/>
<result column="b_social_com_sum" property="bSocialComSum"/>
<result column="b_fund_com_json" property="bFundComJson"/>
<result column="b_fund_com_sum" property="bFundComSum"/>
<result column="b_other_com_json" property="bOtherComJson"/>
<result column="b_other_com_sum" property="bOtherComSum"/>
<result column="b_com_sum" property="bComSum"/>
<result column="b_social_sum" property="bSocialSum"/>
<result column="b_fund_sum" property="bFundSum"/>
<result column="b_other_sum" property="bOtherSum"/>
<result column="b_total" property="bTotal"/>
<result column="b_social_special_json" property="bSocialSpecialJson"/>
<result column="b_fund_special_json" property="bFundSpecialJson"/>
</resultMap>
<select id="qzReportList" parameterType="com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam" resultMap="qzReportListMap">
select a.id
, a.employee_id
, a.status as employee_status
, a.bill_month
, a.bill_status
, a.payment_status
, a.supplementary_month
, a.supplementary_projects
, a.resource_from
, a.social_pay_org
, a.social_account
, a.fund_pay_org
, a.fund_account
, a.supplement_fund_account
, a.other_pay_org
, a.social_scheme_id
, a.social_payment_base_string
, a.social_payment_com_base_string
, a.fund_scheme_id
, a.fund_payment_base_string
, a.fund_payment_com_base_string
, a.other_scheme_id
, a.other_payment_base_string
, a.other_payment_com_base_string
, a.social_per_json
, a.social_per_sum
, a.fund_per_json
, a.fund_per_sum
, a.other_per_json
, a.other_per_sum
, a.per_sum
, a.social_com_json
, a.social_com_sum
, a.fund_com_json
, a.fund_com_sum
, a.other_com_json
, a.other_com_sum
, a.com_sum
, a.social_sum
, a.fund_sum
, a.other_sum
, a.total
, a.payment_organization
, a.subcompany_name
, a.subcompany_id
, a.department_name
, a.department_id
, a.jobtitle_name
, a.jobtitle_id
, a.jobcall
, a.jobcall_id
, a.status
, a.social_special_json
, a.fund_special_json
, b.social_scheme_id as b_social_scheme_id
, b.social_payment_base_string as b_social_payment_base_string
, b.social_payment_com_base_string as b_social_payment_com_base_string
, b.fund_scheme_id as b_fund_scheme_id
, b.fund_payment_base_string as b_fund_payment_base_string
, b.fund_payment_com_base_string as b_fund_payment_com_base_string
, b.other_scheme_id as b_other_scheme_id
, b.other_payment_base_string as b_other_payment_base_string
, b.other_payment_com_base_string as b_other_payment_com_base_string
, b.social_per_json as b_social_per_json
, b.social_per_sum as b_social_per_sum
, b.fund_per_json as b_fund_per_json
, b.fund_per_sum as b_fund_per_sum
, b.other_per_json as b_other_per_json
, b.other_per_sum as b_other_per_sum
, b.per_sum as b_per_sum
, b.social_com_json as b_social_com_json
, b.social_com_sum as b_social_com_sum
, b.fund_com_json as b_fund_com_json
, b.fund_com_sum as b_fund_com_sum
, b.other_com_json as b_other_com_json
, b.other_com_sum as b_other_com_sum
, b.com_sum as b_com_sum
, b.social_sum as b_social_sum
, b.fund_sum as b_fund_sum
, b.other_sum as b_other_sum
, b.total as b_total
from
(select * from hrsa_bill_detail where delete_type = 0 and payment_status=0) a
left join (select * from hrsa_bill_detail where delete_type = 0 and payment_status=1) b on a.employee_id = b.employee_id
left join hrmresource e on e.ID = a.employee_id
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
where a.payment_organization = #{paymentOrganization} and a.bill_month = #{billMonth}
</select>
</mapper>

View File

@ -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);
}

View File

@ -332,5 +332,8 @@ public interface SIAccountService {
void batFile(AccountBatParam param);
void batSocialSecurityBenefitsRecalculate(AccountBatParam batParam);
Object qzReport(QZInsuranceAccountBatchParam qzInsuranceAccountBatchParam);
}

View File

@ -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;
}
}

View File

@ -7190,6 +7190,36 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
}
@Override
public Object qzReport(QZInsuranceAccountBatchParam qzInsuranceAccountBatchParam) {
List<Long> ids = qzInsuranceAccountBatchParam.getIds();
List<QZReportListDTO> list = new ArrayList<>();
for (Long id : ids) {
InsuranceAccountBatchPO batchPO= getInsuranceAccountBatchMapper().getById(id);
Long paymentOrganization = batchPO.getPaymentOrganization();
String billMonth = batchPO.getBillMonth();
InsuranceAccountDetailParam queryParam = InsuranceAccountDetailParam.builder()
.billMonth(billMonth)
.paymentOrganization(paymentOrganization.toString())
.build();
//排序配置
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
queryParam.setOrderRule(orderRule);
//系统人员福利台账明细
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;
}
public void accountOtherView(InsuranceAccountViewListDTO dto, List<InsuranceAccountDetailPO> pos) {
int otherNum = 0;
BigDecimal otherPaySum = new BigDecimal("0");

View File

@ -1220,4 +1220,21 @@ public class SIAccountController {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<BalanceAccountBaseParam, String>(user).run(getSIAccountWrapper(user)::addNewBalance, param);
}
/**
* 获取台账列表页
*
* @param request
* @param response
* @return
*/
@POST
@Path("/qz/list")
@Produces(MediaType.APPLICATION_JSON)
public String qzReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QZInsuranceAccountBatchParam insuranceAccountBatchParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<QZInsuranceAccountBatchParam, Object>(user).run(getService(user)::qzReport, insuranceAccountBatchParam);
}
}