钱智报表开发
This commit is contained in:
parent
4fd9883858
commit
c1492e748b
|
|
@ -0,0 +1,12 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmsalary/qz/report")
|
||||
public class QzSalaryReportController extends com.engine.salary.report.web.QzSalaryReportController{
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
package com.engine.salary.entity.qzreport.bo;
|
||||
|
||||
import com.engine.salary.entity.qzreport.dto.QzSalaryReportDTO;
|
||||
import com.engine.salary.entity.qzreport.po.QzSalaryReportPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/10
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class QzSalaryReportBO {
|
||||
|
||||
/**
|
||||
* 合计
|
||||
*
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
public static QzSalaryReportDTO toSumary(List<QzSalaryReportDTO> po) {
|
||||
return QzSalaryReportDTO.builder()
|
||||
.personCount(po.stream().mapToInt(QzSalaryReportDTO::getPersonCount).sum())
|
||||
.excludePartTimeAndDismissCount(po.stream().mapToInt(QzSalaryReportDTO::getExcludePartTimeAndDismissCount).sum())
|
||||
.basicSalary(po.stream().mapToDouble(QzSalaryReportDTO::getBasicSalary).sum())
|
||||
.postAllowance(po.stream().mapToDouble(QzSalaryReportDTO::getPostAllowance).sum())
|
||||
.performanceBonus(po.stream().mapToDouble(QzSalaryReportDTO::getPerformanceBonus).sum())
|
||||
.fullAttendanceSalary(po.stream().mapToDouble(QzSalaryReportDTO::getFullAttendanceSalary).sum())
|
||||
.monthStandardSalary(po.stream().mapToDouble(QzSalaryReportDTO::getMonthStandardSalary).sum())
|
||||
.workdays(po.stream().mapToInt(QzSalaryReportDTO::getWorkdays).sum())
|
||||
.actualMonthSalary(po.stream().mapToDouble(QzSalaryReportDTO::getActualMonthSalary).sum())
|
||||
.subsidy(po.stream().mapToDouble(QzSalaryReportDTO::getSubsidy).sum())
|
||||
.commission(po.stream().mapToDouble(QzSalaryReportDTO::getCommission).sum())
|
||||
.bonus(po.stream().mapToDouble(QzSalaryReportDTO::getBonus).sum())
|
||||
.performanceAssessment(po.stream().mapToDouble(QzSalaryReportDTO::getPerformanceAssessment).sum())
|
||||
.commissionReserveReturn(po.stream().mapToDouble(QzSalaryReportDTO::getCommissionReserveReturn).sum())
|
||||
.notFullAttendanceDeduction(po.stream().mapToDouble(QzSalaryReportDTO::getNotFullAttendanceDeduction).sum())
|
||||
.balance(po.stream().mapToDouble(QzSalaryReportDTO::getBalance).sum())
|
||||
.leaveDeduction(po.stream().mapToDouble(QzSalaryReportDTO::getLeaveDeduction).sum())
|
||||
.sickLeaveDeduction(po.stream().mapToDouble(QzSalaryReportDTO::getSickLeaveDeduction).sum())
|
||||
.absenteeismDeduction(po.stream().mapToDouble(QzSalaryReportDTO::getAbsenteeismDeduction).sum())
|
||||
.commissionReserve(po.stream().mapToDouble(QzSalaryReportDTO::getCommissionReserve).sum())
|
||||
.externalRefund(po.stream().mapToDouble(QzSalaryReportDTO::getExternalRefund).sum())
|
||||
.otherDeduction(po.stream().mapToDouble(QzSalaryReportDTO::getOtherDeduction).sum())
|
||||
.lastMonthArrears(po.stream().mapToDouble(QzSalaryReportDTO::getLastMonthArrears).sum())
|
||||
.subtotal(po.stream().mapToDouble(QzSalaryReportDTO::getSubtotal).sum())
|
||||
.payableSalary(po.stream().mapToDouble(QzSalaryReportDTO::getPayableSalary).sum())
|
||||
.socialInsurancePaymentSum(po.stream().mapToDouble(QzSalaryReportDTO::getSocialInsurancePaymentSum).sum())
|
||||
.personalFundPaymentSum(po.stream().mapToDouble(QzSalaryReportDTO::getPersonalFundPaymentSum).sum())
|
||||
.taxableSalary(po.stream().mapToDouble(QzSalaryReportDTO::getTaxableSalary).sum())
|
||||
.thisTimeDeductionTax(po.stream().mapToDouble(QzSalaryReportDTO::getThisTimeDeductionTax).sum())
|
||||
.dismissalCompensation(po.stream().mapToDouble(QzSalaryReportDTO::getDismissalCompensation).sum())
|
||||
.afterTaxSalary(po.stream().mapToDouble(QzSalaryReportDTO::getAfterTaxSalary).sum())
|
||||
.actualPaymentSum(po.stream().mapToDouble(QzSalaryReportDTO::getActualPaymentSum).sum())
|
||||
.personalArrears(po.stream().mapToDouble(QzSalaryReportDTO::getPersonalArrears).sum())
|
||||
.businessDepartmentYearPerformance(po.stream().mapToDouble(QzSalaryReportDTO::getBusinessDepartmentYearPerformance).sum())
|
||||
.annualEndowmentSum(po.stream().mapToDouble(QzSalaryReportDTO::getAnnualEndowmentSum).sum())
|
||||
.companySocialInsurancePaymentSum(po.stream().mapToDouble(QzSalaryReportDTO::getCompanySocialInsurancePaymentSum).sum())
|
||||
.companyFundPaymentSum(po.stream().mapToDouble(QzSalaryReportDTO::getCompanyFundPaymentSum).sum())
|
||||
.archiveManagementFee(po.stream().mapToDouble(QzSalaryReportDTO::getArchiveManagementFee).sum())
|
||||
.archiveManagementFeeRepayment(po.stream().mapToDouble(QzSalaryReportDTO::getArchiveManagementFeeRepayment).sum())
|
||||
.serviceFee(po.stream().mapToDouble(QzSalaryReportDTO::getServiceFee).sum())
|
||||
.serviceFeeRepayment(po.stream().mapToDouble(QzSalaryReportDTO::getServiceFeeRepayment).sum())
|
||||
.companyMonthlyPaymentSum(po.stream().mapToDouble(QzSalaryReportDTO::getCompanyMonthlyPaymentSum).sum())
|
||||
.companyTotalCost(po.stream().mapToDouble(QzSalaryReportDTO::getCompanyTotalCost).sum())
|
||||
.salaryReimbursement(po.stream().mapToDouble(QzSalaryReportDTO::getSalaryReimbursement).sum())
|
||||
.totalActualPaymentIncome(po.stream().mapToDouble(QzSalaryReportDTO::getTotalActualPaymentIncome).sum())
|
||||
.totalCompanyCost(po.stream().mapToDouble(QzSalaryReportDTO::getTotalCompanyCost).sum())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static QzSalaryReportDTO toDTO(List<QzSalaryReportPO> po) {
|
||||
return QzSalaryReportDTO.builder()
|
||||
.personCount(po.size())
|
||||
.excludePartTimeAndDismissCount((int) po.stream().filter(item -> item.getActualMonthSalary() > 0).count())
|
||||
.basicSalary(po.stream().mapToDouble(QzSalaryReportPO::getBasicSalary).sum())
|
||||
.postAllowance(po.stream().mapToDouble(QzSalaryReportPO::getPostAllowance).sum())
|
||||
.performanceBonus(po.stream().mapToDouble(QzSalaryReportPO::getPerformanceBonus).sum())
|
||||
.fullAttendanceSalary(po.stream().mapToDouble(QzSalaryReportPO::getFullAttendanceSalary).sum())
|
||||
.monthStandardSalary(po.stream().mapToDouble(QzSalaryReportPO::getMonthStandardSalary).sum())
|
||||
.workdays(po.stream().mapToInt(QzSalaryReportPO::getWorkdays).sum())
|
||||
.actualMonthSalary(po.stream().mapToDouble(QzSalaryReportPO::getActualMonthSalary).sum())
|
||||
.subsidy(po.stream().mapToDouble(QzSalaryReportPO::getSubsidy).sum())
|
||||
.commission(po.stream().mapToDouble(QzSalaryReportPO::getCommission).sum())
|
||||
.bonus(po.stream().mapToDouble(QzSalaryReportPO::getBonus).sum())
|
||||
.performanceAssessment(po.stream().mapToDouble(QzSalaryReportPO::getPerformanceAssessment).sum())
|
||||
.commissionReserveReturn(po.stream().mapToDouble(QzSalaryReportPO::getCommissionReserveReturn).sum())
|
||||
.notFullAttendanceDeduction(po.stream().mapToDouble(QzSalaryReportPO::getNotFullAttendanceDeduction).sum())
|
||||
.balance(po.stream().mapToDouble(QzSalaryReportPO::getBalance).sum())
|
||||
.leaveDeduction(po.stream().mapToDouble(QzSalaryReportPO::getLeaveDeduction).sum())
|
||||
.sickLeaveDeduction(po.stream().mapToDouble(QzSalaryReportPO::getSickLeaveDeduction).sum())
|
||||
.absenteeismDeduction(po.stream().mapToDouble(QzSalaryReportPO::getAbsenteeismDeduction).sum())
|
||||
.commissionReserve(po.stream().mapToDouble(QzSalaryReportPO::getCommissionReserve).sum())
|
||||
.externalRefund(po.stream().mapToDouble(QzSalaryReportPO::getExternalRefund).sum())
|
||||
.otherDeduction(po.stream().mapToDouble(QzSalaryReportPO::getOtherDeduction).sum())
|
||||
.lastMonthArrears(po.stream().mapToDouble(QzSalaryReportPO::getLastMonthArrears).sum())
|
||||
.subtotal(po.stream().mapToDouble(QzSalaryReportPO::getSubtotal).sum())
|
||||
.payableSalary(po.stream().mapToDouble(QzSalaryReportPO::getPayableSalary).sum())
|
||||
.socialInsurancePaymentSum(po.stream().mapToDouble(QzSalaryReportPO::getSocialInsurancePaymentSum).sum())
|
||||
.personalFundPaymentSum(po.stream().mapToDouble(QzSalaryReportPO::getPersonalFundPaymentSum).sum())
|
||||
.taxableSalary(po.stream().mapToDouble(QzSalaryReportPO::getTaxableSalary).sum())
|
||||
.thisTimeDeductionTax(po.stream().mapToDouble(QzSalaryReportPO::getThisTimeDeductionTax).sum())
|
||||
.dismissalCompensation(po.stream().mapToDouble(QzSalaryReportPO::getDismissalCompensation).sum())
|
||||
.afterTaxSalary(po.stream().mapToDouble(QzSalaryReportPO::getAfterTaxSalary).sum())
|
||||
.actualPaymentSum(po.stream().mapToDouble(QzSalaryReportPO::getActualPaymentSum).sum())
|
||||
.personalArrears(po.stream().mapToDouble(QzSalaryReportPO::getPersonalArrears).sum())
|
||||
.businessDepartmentYearPerformance(po.stream().mapToDouble(QzSalaryReportPO::getBusinessDepartmentYearPerformance).sum())
|
||||
.annualEndowmentSum(po.stream().mapToDouble(QzSalaryReportPO::getAnnualEndowmentSum).sum())
|
||||
.companySocialInsurancePaymentSum(po.stream().mapToDouble(QzSalaryReportPO::getCompanySocialInsurancePaymentSum).sum())
|
||||
.companyFundPaymentSum(po.stream().mapToDouble(QzSalaryReportPO::getCompanyFundPaymentSum).sum())
|
||||
.archiveManagementFee(po.stream().mapToDouble(QzSalaryReportPO::getArchiveManagementFee).sum())
|
||||
.archiveManagementFeeRepayment(po.stream().mapToDouble(QzSalaryReportPO::getArchiveManagementFeeRepayment).sum())
|
||||
.serviceFee(po.stream().mapToDouble(QzSalaryReportPO::getServiceFee).sum())
|
||||
.serviceFeeRepayment(po.stream().mapToDouble(QzSalaryReportPO::getServiceFeeRepayment).sum())
|
||||
.companyMonthlyPaymentSum(po.stream().mapToDouble(QzSalaryReportPO::getCompanyMonthlyPaymentSum).sum())
|
||||
.companyTotalCost(po.stream().mapToDouble(QzSalaryReportPO::getCompanyTotalCost).sum())
|
||||
.salaryReimbursement(po.stream().mapToDouble(QzSalaryReportPO::getSalaryReimbursement).sum())
|
||||
.totalActualPaymentIncome(po.stream().mapToDouble(QzSalaryReportPO::getTotalActualPaymentIncome).sum())
|
||||
.totalCompanyCost(po.stream().mapToDouble(QzSalaryReportPO::getTotalCompanyCost).sum())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分割QzSalaryReportPO
|
||||
*
|
||||
* @param po
|
||||
* @param split
|
||||
* @param total
|
||||
* @return
|
||||
*/
|
||||
public static QzSalaryReportPO splitQzSalaryReportPO(QzSalaryReportPO po, int split, int total) {
|
||||
if (total == 0) {
|
||||
throw new IllegalArgumentException("total不能为0");
|
||||
}
|
||||
|
||||
double ratio = (double) split / total;
|
||||
return QzSalaryReportPO.builder()
|
||||
.basicSalary(Math.round(po.getBasicSalary() * ratio * 100.0) / 100.0)
|
||||
.postAllowance(Math.round(po.getPostAllowance() * ratio * 100.0) / 100.0)
|
||||
.performanceBonus(Math.round(po.getPerformanceBonus() * ratio * 100.0) / 100.0)
|
||||
.fullAttendanceSalary(Math.round(po.getFullAttendanceSalary() * ratio * 100.0) / 100.0)
|
||||
.monthStandardSalary(Math.round(po.getMonthStandardSalary() * ratio * 100.0) / 100.0)
|
||||
.workdays((int) (po.getWorkdays() * ratio))
|
||||
.actualMonthSalary(Math.round(po.getActualMonthSalary() * ratio * 100.0) / 100.0)
|
||||
.subsidy(Math.round(po.getSubsidy() * ratio * 100.0) / 100.0)
|
||||
.commission(Math.round(po.getCommission() * ratio * 100.0) / 100.0)
|
||||
.bonus(Math.round(po.getBonus() * ratio * 100.0) / 100.0)
|
||||
.performanceAssessment(Math.round(po.getPerformanceAssessment() * ratio * 100.0) / 100.0)
|
||||
.commissionReserveReturn(Math.round(po.getCommissionReserveReturn() * ratio * 100.0) / 100.0)
|
||||
.notFullAttendanceDeduction(Math.round(po.getNotFullAttendanceDeduction() * ratio * 100.0) / 100.0)
|
||||
.balance(Math.round(po.getBalance() * ratio * 100.0) / 100.0)
|
||||
.leaveDeduction(Math.round(po.getLeaveDeduction() * ratio * 100.0) / 100.0)
|
||||
.sickLeaveDeduction(Math.round(po.getSickLeaveDeduction() * ratio * 100.0) / 100.0)
|
||||
.absenteeismDeduction(Math.round(po.getAbsenteeismDeduction() * ratio * 100.0) / 100.0)
|
||||
.commissionReserve(Math.round(po.getCommissionReserve() * ratio * 100.0) / 100.0)
|
||||
.externalRefund(Math.round(po.getExternalRefund() * ratio * 100.0) / 100.0)
|
||||
.otherDeduction(Math.round(po.getOtherDeduction() * ratio * 100.0) / 100.0)
|
||||
.lastMonthArrears(Math.round(po.getLastMonthArrears() * ratio * 100.0) / 100.0)
|
||||
.subtotal(Math.round(po.getSubtotal() * ratio * 100.0) / 100.0)
|
||||
.payableSalary(Math.round(po.getPayableSalary() * ratio * 100.0) / 100.0)
|
||||
.socialInsurancePaymentSum(Math.round(po.getSocialInsurancePaymentSum() * ratio * 100.0) / 100.0)
|
||||
.personalFundPaymentSum(Math.round(po.getPersonalFundPaymentSum() * ratio * 100.0) / 100.0)
|
||||
.taxableSalary(Math.round(po.getTaxableSalary() * ratio * 100.0) / 100.0)
|
||||
.thisTimeDeductionTax(Math.round(po.getThisTimeDeductionTax() * ratio * 100.0) / 100.0)
|
||||
.dismissalCompensation(Math.round(po.getDismissalCompensation() * ratio * 100.0) / 100.0)
|
||||
.afterTaxSalary(Math.round(po.getAfterTaxSalary() * ratio * 100.0) / 100.0)
|
||||
.actualPaymentSum(Math.round(po.getActualPaymentSum() * ratio * 100.0) / 100.0)
|
||||
.personalArrears(Math.round(po.getPersonalArrears() * ratio * 100.0) / 100.0)
|
||||
.businessDepartmentYearPerformance(Math.round(po.getBusinessDepartmentYearPerformance() * ratio * 100.0) / 100.0)
|
||||
.annualEndowmentSum(Math.round(po.getAnnualEndowmentSum() * ratio * 100.0) / 100.0)
|
||||
.companySocialInsurancePaymentSum(Math.round(po.getCompanySocialInsurancePaymentSum() * ratio * 100.0) / 100.0)
|
||||
.companyFundPaymentSum(Math.round(po.getCompanyFundPaymentSum() * ratio * 100.0) / 100.0)
|
||||
.archiveManagementFee(Math.round(po.getArchiveManagementFee() * ratio * 100.0) / 100.0)
|
||||
.archiveManagementFeeRepayment(Math.round(po.getArchiveManagementFeeRepayment() * ratio * 100.0) / 100.0)
|
||||
.serviceFee(Math.round(po.getServiceFee() * ratio * 100.0) / 100.0)
|
||||
.serviceFeeRepayment(Math.round(po.getServiceFeeRepayment() * ratio * 100.0) / 100.0)
|
||||
.companyMonthlyPaymentSum(Math.round(po.getCompanyMonthlyPaymentSum() * ratio * 100.0) / 100.0)
|
||||
.companyTotalCost(Math.round(po.getCompanyTotalCost() * ratio * 100.0) / 100.0)
|
||||
.salaryReimbursement(Math.round(po.getSalaryReimbursement() * ratio * 100.0) / 100.0)
|
||||
.totalActualPaymentIncome(Math.round(po.getTotalActualPaymentIncome() * ratio * 100.0) / 100.0)
|
||||
.totalCompanyCost(Math.round(po.getTotalCompanyCost() * ratio * 100.0) / 100.0)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
package com.engine.salary.entity.qzreport.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class QzSalaryReportDTO {
|
||||
/**
|
||||
* 所属公司
|
||||
*/
|
||||
private String companyName;
|
||||
/**
|
||||
* 人员数目
|
||||
*/
|
||||
private Integer personCount;
|
||||
/**
|
||||
* 剔除兼职和离职预留人数
|
||||
*/
|
||||
private Integer excludePartTimeAndDismissCount;
|
||||
/**
|
||||
* 基本工资
|
||||
*/
|
||||
private Double basicSalary;
|
||||
/**
|
||||
* 岗位津贴
|
||||
*/
|
||||
private Double postAllowance;
|
||||
/**
|
||||
* 绩效奖金
|
||||
*/
|
||||
private Double performanceBonus;
|
||||
/**
|
||||
* 全勤工资
|
||||
*/
|
||||
private Double fullAttendanceSalary;
|
||||
/**
|
||||
* 月标准工资
|
||||
*/
|
||||
private Double monthStandardSalary;
|
||||
/**
|
||||
* 应出勤天数
|
||||
*/
|
||||
private Integer workdays;
|
||||
/**
|
||||
* 实际月薪
|
||||
*/
|
||||
private Double actualMonthSalary;
|
||||
/**
|
||||
* 补贴
|
||||
*/
|
||||
private Double subsidy;
|
||||
/**
|
||||
* 提成
|
||||
*/
|
||||
private Double commission;
|
||||
/**
|
||||
* 奖金
|
||||
*/
|
||||
private Double bonus;
|
||||
/**
|
||||
* 绩效考核
|
||||
*/
|
||||
private Double performanceAssessment;
|
||||
/**
|
||||
* 提成预留返还
|
||||
*/
|
||||
private Double commissionReserveReturn;
|
||||
/**
|
||||
* 未全勤扣款
|
||||
*/
|
||||
private Double notFullAttendanceDeduction;
|
||||
/**
|
||||
* 补差
|
||||
*/
|
||||
private Double balance;
|
||||
/**
|
||||
* 事假扣款
|
||||
*/
|
||||
private Double leaveDeduction;
|
||||
/**
|
||||
* 病假扣款
|
||||
*/
|
||||
private Double sickLeaveDeduction;
|
||||
/**
|
||||
* 旷工扣款
|
||||
*/
|
||||
private Double absenteeismDeduction;
|
||||
/**
|
||||
* 提成预留
|
||||
*/
|
||||
private Double commissionReserve;
|
||||
/**
|
||||
* 外部退费
|
||||
*/
|
||||
private Double externalRefund;
|
||||
/**
|
||||
* 其他扣款
|
||||
*/
|
||||
private Double otherDeduction;
|
||||
/**
|
||||
* 上月欠款
|
||||
*/
|
||||
private Double lastMonthArrears;
|
||||
/**
|
||||
* 小计
|
||||
*/
|
||||
private Double subtotal;
|
||||
/**
|
||||
* 应发工资
|
||||
*/
|
||||
private Double payableSalary;
|
||||
/**
|
||||
* 个人社保缴纳合计
|
||||
*/
|
||||
private Double socialInsurancePaymentSum;
|
||||
/**
|
||||
* 个人公积金缴纳合计
|
||||
*/
|
||||
private Double personalFundPaymentSum;
|
||||
/**
|
||||
* 税前工资
|
||||
*/
|
||||
private Double taxableSalary;
|
||||
/**
|
||||
* 本次代扣税
|
||||
*/
|
||||
private Double thisTimeDeductionTax;
|
||||
/**
|
||||
* 解聘补偿
|
||||
*/
|
||||
private Double dismissalCompensation;
|
||||
/**
|
||||
* 税后工资
|
||||
*/
|
||||
private Double afterTaxSalary;
|
||||
/**
|
||||
* 实发合计(工资代发)
|
||||
*/
|
||||
private Double actualPaymentSum;
|
||||
/**
|
||||
* 个人欠款
|
||||
*/
|
||||
private Double personalArrears;
|
||||
/**
|
||||
* 业务部门年度绩效
|
||||
*/
|
||||
private Double businessDepartmentYearPerformance;
|
||||
/**
|
||||
* 年终奖合计
|
||||
*/
|
||||
private Double annualEndowmentSum;
|
||||
/**
|
||||
* 单位社保缴纳合计
|
||||
*/
|
||||
private Double companySocialInsurancePaymentSum;
|
||||
/**
|
||||
* 单位公积金缴纳合计
|
||||
*/
|
||||
private Double companyFundPaymentSum;
|
||||
/**
|
||||
* 档案管理费
|
||||
*/
|
||||
private Double archiveManagementFee;
|
||||
/**
|
||||
* 档案管理费补缴
|
||||
*/
|
||||
private Double archiveManagementFeeRepayment;
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
private Double serviceFee;
|
||||
/**
|
||||
* 服务费补缴
|
||||
*/
|
||||
private Double serviceFeeRepayment;
|
||||
/**
|
||||
* 单位月缴纳合计
|
||||
*/
|
||||
private Double companyMonthlyPaymentSum;
|
||||
/**
|
||||
* 公司总成本
|
||||
*/
|
||||
private Double companyTotalCost;
|
||||
/**
|
||||
* 工资走报销
|
||||
*/
|
||||
private Double salaryReimbursement;
|
||||
/**
|
||||
* 员工实发总收入(含报销)
|
||||
*/
|
||||
private Double totalActualPaymentIncome;
|
||||
/**
|
||||
* 公司总成本(含报销)
|
||||
*/
|
||||
private Double totalCompanyCost;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.engine.salary.entity.qzreport.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class QzSalaryReportParam extends BaseQueryParam {
|
||||
private String month;
|
||||
private String workplaceId;
|
||||
private Set<String> workplaceIdSet;
|
||||
|
||||
public Set<String> getWorkplaceIdSet() {
|
||||
if (StringUtils.isNotBlank(workplaceId)) {
|
||||
workplaceIdSet = new HashSet<>(Arrays.asList(workplaceId.split(",")));
|
||||
}
|
||||
return workplaceIdSet;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.salary.entity.qzreport.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class QzActualWorkplace {
|
||||
private Integer departmentId;
|
||||
private Integer workplaceId;
|
||||
private String departmentName;
|
||||
private String workplaceName;
|
||||
}
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
package com.engine.salary.entity.qzreport.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class QzSalaryReportPO {
|
||||
/**
|
||||
* 基本工资
|
||||
*/
|
||||
private Double basicSalary;
|
||||
/**
|
||||
* 岗位津贴
|
||||
*/
|
||||
private Double postAllowance;
|
||||
/**
|
||||
* 绩效奖金
|
||||
*/
|
||||
private Double performanceBonus;
|
||||
/**
|
||||
* 全勤工资
|
||||
*/
|
||||
private Double fullAttendanceSalary;
|
||||
/**
|
||||
* 月标准工资
|
||||
*/
|
||||
private Double monthStandardSalary;
|
||||
/**
|
||||
* 应出勤天数
|
||||
*/
|
||||
private Integer workdays;
|
||||
/**
|
||||
* 实际月薪
|
||||
*/
|
||||
private Double actualMonthSalary;
|
||||
/**
|
||||
* 补贴
|
||||
*/
|
||||
private Double subsidy;
|
||||
/**
|
||||
* 提成
|
||||
*/
|
||||
private Double commission;
|
||||
/**
|
||||
* 奖金
|
||||
*/
|
||||
private Double bonus;
|
||||
/**
|
||||
* 绩效考核
|
||||
*/
|
||||
private Double performanceAssessment;
|
||||
/**
|
||||
* 提成预留返还
|
||||
*/
|
||||
private Double commissionReserveReturn;
|
||||
/**
|
||||
* 未全勤扣款
|
||||
*/
|
||||
private Double notFullAttendanceDeduction;
|
||||
/**
|
||||
* 补差
|
||||
*/
|
||||
private Double balance;
|
||||
/**
|
||||
* 事假扣款
|
||||
*/
|
||||
private Double leaveDeduction;
|
||||
/**
|
||||
* 病假扣款
|
||||
*/
|
||||
private Double sickLeaveDeduction;
|
||||
/**
|
||||
* 旷工扣款
|
||||
*/
|
||||
private Double absenteeismDeduction;
|
||||
/**
|
||||
* 提成预留
|
||||
*/
|
||||
private Double commissionReserve;
|
||||
/**
|
||||
* 外部退费
|
||||
*/
|
||||
private Double externalRefund;
|
||||
/**
|
||||
* 其他扣款
|
||||
*/
|
||||
private Double otherDeduction;
|
||||
/**
|
||||
* 上月欠款
|
||||
*/
|
||||
private Double lastMonthArrears;
|
||||
/**
|
||||
* 小计
|
||||
*/
|
||||
private Double subtotal;
|
||||
/**
|
||||
* 应发工资
|
||||
*/
|
||||
private Double payableSalary;
|
||||
/**
|
||||
* 个人社保缴纳合计
|
||||
*/
|
||||
private Double socialInsurancePaymentSum;
|
||||
/**
|
||||
* 个人公积金缴纳合计
|
||||
*/
|
||||
private Double personalFundPaymentSum;
|
||||
/**
|
||||
* 税前工资
|
||||
*/
|
||||
private Double taxableSalary;
|
||||
/**
|
||||
* 本次代扣税
|
||||
*/
|
||||
private Double thisTimeDeductionTax;
|
||||
/**
|
||||
* 解聘补偿
|
||||
*/
|
||||
private Double dismissalCompensation;
|
||||
/**
|
||||
* 税后工资
|
||||
*/
|
||||
private Double afterTaxSalary;
|
||||
/**
|
||||
* 实发合计(工资代发)
|
||||
*/
|
||||
private Double actualPaymentSum;
|
||||
/**
|
||||
* 个人欠款
|
||||
*/
|
||||
private Double personalArrears;
|
||||
/**
|
||||
* 业务部门年度绩效
|
||||
*/
|
||||
private Double businessDepartmentYearPerformance;
|
||||
/**
|
||||
* 年终奖合计
|
||||
*/
|
||||
private Double annualEndowmentSum;
|
||||
/**
|
||||
* 单位社保缴纳合计
|
||||
*/
|
||||
private Double companySocialInsurancePaymentSum;
|
||||
/**
|
||||
* 单位公积金缴纳合计
|
||||
*/
|
||||
private Double companyFundPaymentSum;
|
||||
/**
|
||||
* 档案管理费
|
||||
*/
|
||||
private Double archiveManagementFee;
|
||||
/**
|
||||
* 档案管理费补缴
|
||||
*/
|
||||
private Double archiveManagementFeeRepayment;
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
private Double serviceFee;
|
||||
/**
|
||||
* 服务费补缴
|
||||
*/
|
||||
private Double serviceFeeRepayment;
|
||||
/**
|
||||
* 单位月缴纳合计
|
||||
*/
|
||||
private Double companyMonthlyPaymentSum;
|
||||
/**
|
||||
* 公司总成本
|
||||
*/
|
||||
private Double companyTotalCost;
|
||||
/**
|
||||
* 工资走报销
|
||||
*/
|
||||
private Double salaryReimbursement;
|
||||
/**
|
||||
* 员工实发总收入(含报销)
|
||||
*/
|
||||
private Double totalActualPaymentIncome;
|
||||
/**
|
||||
* 公司总成本(含报销)
|
||||
*/
|
||||
private Double totalCompanyCost;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.engine.salary.entity.qzreport.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class QzUserChangeRecord {
|
||||
private Integer userId;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private Integer beforeDepartment;
|
||||
private Integer afterDepartment;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.engine.salary.entity.qzreport.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class QzUserSalaryInfo {
|
||||
private Integer userId;
|
||||
private Integer taxAgentId;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.mapper.qzreport;
|
||||
|
||||
import com.engine.salary.entity.qzreport.po.QzActualWorkplace;
|
||||
import com.engine.salary.entity.qzreport.po.QzUserChangeRecord;
|
||||
import com.engine.salary.entity.qzreport.po.QzUserSalaryInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface QzSalaryReportMapper {
|
||||
|
||||
/**
|
||||
* 获取实际工作地点
|
||||
*
|
||||
* @param workplaceIdSet
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
List<QzActualWorkplace> getActualWorkplaceList(@Param("workplaceIdSet") Set<String> workplaceIdSet, @Param("month") String month);
|
||||
|
||||
List<QzUserSalaryInfo> getUserSalaryInfoList(@Param("month") String month);
|
||||
|
||||
List<QzUserChangeRecord> getUserChangeRecordList(@Param("userId") Integer userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.qzreport.QzSalaryReportMapper">
|
||||
|
||||
|
||||
<select id="getActualWorkplaceList" resultType="com.engine.salary.entity.qzreport.po.QzActualWorkplace">
|
||||
select
|
||||
b.id as departmentId ,
|
||||
c.id as workplaceId,
|
||||
b.departmentname as departmentName,
|
||||
c.locationname as workplaceName
|
||||
from
|
||||
uf_sjgzd a
|
||||
inner join hrmdepartment b on
|
||||
a.bm = b.id
|
||||
inner join hrmlocations c on
|
||||
a.bgdd = c.id
|
||||
where 1=1
|
||||
<if test="workplaceIdSet != null and workplaceIdSet.size >0">
|
||||
and a.bgdd in
|
||||
<foreach item="item" index="index" collection="workplaceIdSet" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="month != null">
|
||||
and a.jsyf >= #{month} and a.ksyf <![CDATA[<=]]> #{month}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getUserSalaryInfoList" resultType="com.engine.salary.entity.qzreport.po.QzUserSalaryInfo">
|
||||
select e.id as userId,result.tax_agent_id as taxAgentId
|
||||
from hrsa_salary_acct_record record
|
||||
inner join hrsa_salary_acct_result result on record.id = result.salary_acct_record_id and result.delete_type = 0
|
||||
and record.delete_type = 0
|
||||
inner join hrsa_salary_item item on result.salary_item_id = item.id and item.delete_type = 0
|
||||
inner join hrmresource e on e.id= result.employee_id
|
||||
where 1=1
|
||||
<if test=" month !=null ">
|
||||
and record.salary_month = #{month}
|
||||
</if>
|
||||
group by result.tax_agent_id,e.id,record.salary_month
|
||||
order by userId,salary_month
|
||||
</select>
|
||||
|
||||
<select id="getUserChangeRecordList" resultType="com.engine.salary.entity.qzreport.po.QzUserChangeRecord">
|
||||
select
|
||||
a.shenxrq as startDate,
|
||||
a.sxrq as endDate,
|
||||
a.bdqbm as beforeDepartment,
|
||||
a.bdhbm as afterDepartment
|
||||
from
|
||||
uf_rzjl a
|
||||
where yg = #{userId}
|
||||
and a.sxrq > #{startDate} and a.shenxrq <![CDATA[<=]]> #{endDate}
|
||||
order by a.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.engine.salary.report.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.qzreport.param.QzSalaryReportParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.QzSalaryReportWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class QzSalaryReportController {
|
||||
|
||||
private QzSalaryReportWrapper getQzSalaryReportWrapper(User user) {
|
||||
return ServiceUtil.getService(QzSalaryReportWrapper.class, user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取薪酬统计报表数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/getSalaryReport")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalaryReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QzSalaryReportParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<QzSalaryReportParam, Map<String, Object>>(user).run(getQzSalaryReportWrapper(user)::getSalaryReport, param);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.qzreport.param.QzSalaryReportParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface QzSalaryReportService {
|
||||
|
||||
Map<String,Object> getSalaryReport(QzSalaryReportParam param);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.entity.qzreport.bo.QzSalaryReportBO;
|
||||
import com.engine.salary.entity.qzreport.dto.QzSalaryReportDTO;
|
||||
import com.engine.salary.entity.qzreport.param.QzSalaryReportParam;
|
||||
import com.engine.salary.entity.qzreport.po.QzActualWorkplace;
|
||||
import com.engine.salary.entity.qzreport.po.QzSalaryReportPO;
|
||||
import com.engine.salary.entity.qzreport.po.QzUserChangeRecord;
|
||||
import com.engine.salary.entity.qzreport.po.QzUserSalaryInfo;
|
||||
import com.engine.salary.mapper.qzreport.QzSalaryReportMapper;
|
||||
import com.engine.salary.service.QzSalaryReportService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.schedule.manager.HrmScheduleManager;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class QzSalaryReportServiceImpl extends Service implements QzSalaryReportService {
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
private QzSalaryReportMapper getQzSalaryReportMapper() {
|
||||
return MapperProxyFactory.getProxy(QzSalaryReportMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSalaryReport(QzSalaryReportParam param) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
|
||||
String month = param.getMonth();
|
||||
if (StringUtils.isBlank(month)) {
|
||||
month = DateUtil.getYear() + "-" + DateUtil.getMonth();
|
||||
}
|
||||
String firstDayOfMonth = DateUtil.getFirstDayOfMonth(month + "-01");
|
||||
String lastDayOfMonth = DateUtil.getLastDayOfMonth(month + "-01");
|
||||
|
||||
List<QzSalaryReportDTO> dtoList = new ArrayList<>();
|
||||
|
||||
// 查询当前月份的实际工作地
|
||||
List<QzActualWorkplace> actualWorkplaceList = getQzSalaryReportMapper().getActualWorkplaceList(param.getWorkplaceIdSet(), month);
|
||||
if (CollectionUtils.isNotEmpty(actualWorkplaceList)) {
|
||||
Map<Integer, List<QzActualWorkplace>> actualWorkplaceMap = actualWorkplaceList.stream().collect(Collectors.groupingBy(QzActualWorkplace::getWorkplaceId));
|
||||
Map<Integer, String> departmentMap = actualWorkplaceList.stream().collect(Collectors.toMap(QzActualWorkplace::getDepartmentId, QzActualWorkplace::getWorkplaceName));
|
||||
|
||||
Map<Integer, ArrayList<QzSalaryReportPO>> poListMap = actualWorkplaceList.stream().collect(Collectors.toMap(QzActualWorkplace::getWorkplaceId, item -> new ArrayList<>(), (k1, k2) -> k1));
|
||||
|
||||
|
||||
List<QzUserSalaryInfo> userSalaryInfoList = getQzSalaryReportMapper().getUserSalaryInfoList(firstDayOfMonth);
|
||||
Map<Integer, Set<Integer>> userIdTaxAgentIdMap = userSalaryInfoList.stream()
|
||||
.filter(info -> info.getUserId() != null && info.getTaxAgentId() != null)
|
||||
.collect(Collectors.groupingBy(QzUserSalaryInfo::getUserId,
|
||||
Collectors.mapping(QzUserSalaryInfo::getTaxAgentId, Collectors.toSet())));
|
||||
|
||||
// 遍历人员,构建每个人员各个账套的薪资项目汇总
|
||||
for (Integer userId : userIdTaxAgentIdMap.keySet()) {
|
||||
QzSalaryReportPO po = new QzSalaryReportPO();
|
||||
Set<Integer> taxAgentIdSet = userIdTaxAgentIdMap.get(userId);
|
||||
for (Integer taxAgentId : taxAgentIdSet) {
|
||||
Map<String, String> salaryItemMap = new HashMap<>();
|
||||
rs.executeQuery("select item.name ,result.result_value " +
|
||||
"from hrsa_salary_acct_record record " +
|
||||
"inner join hrsa_salary_acct_result result on record.id = result.salary_acct_record_id and result.delete_type = 0 and record.delete_type = 0 " +
|
||||
"inner join hrsa_salary_item item on result.salary_item_id = item.id and item.delete_type = 0 " +
|
||||
"inner join hrmresource e on e.id= result.employee_id " +
|
||||
"where e.id = ? and record.salary_month=? and result.tax_agent_id=? ", userId, firstDayOfMonth, taxAgentId);
|
||||
while (rs.next()) {
|
||||
// 获取薪资项的值,并解密
|
||||
salaryItemMap.put(rs.getString("name"), AESEncryptUtil.decrypt(rs.getString("result_value")));
|
||||
}
|
||||
// 构建薪资项目数据
|
||||
buildSalaryReportPO(po, salaryItemMap);
|
||||
}
|
||||
|
||||
|
||||
// 查询该人员是否有部门变动
|
||||
List<QzUserChangeRecord> userChangeRecordList = getQzSalaryReportMapper().getUserChangeRecordList(userId, firstDayOfMonth, lastDayOfMonth);
|
||||
// 去除起始时间为空,或者为同一天的数据
|
||||
userChangeRecordList = userChangeRecordList.stream().filter(record -> StringUtils.isNotBlank(record.getStartDate()) && StringUtils.isNotBlank(record.getEndDate()) && !record.getStartDate().equals(record.getEndDate())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(userChangeRecordList)) {
|
||||
// 直接写入对应办公地点
|
||||
int userDepartment = new User(userId).getUserDepartment();
|
||||
poListMap.get(userDepartment).add(po);
|
||||
} else {
|
||||
int totalWorkDays = Convert.toInt(getWorkDays(firstDayOfMonth, lastDayOfMonth, userId), 0);
|
||||
// 按时间拆分、汇总
|
||||
Map<Integer, List<QzUserChangeRecord>> changeRecordMap = userChangeRecordList.stream().collect(Collectors.groupingBy(QzUserChangeRecord::getAfterDepartment));
|
||||
for (Integer departmentId : changeRecordMap.keySet()) {
|
||||
List<QzUserChangeRecord> qzUserChangeRecords = changeRecordMap.get(departmentId);
|
||||
// 汇总天数
|
||||
int workdays = 0;
|
||||
for (QzUserChangeRecord qzUserChangeRecord : qzUserChangeRecords) {
|
||||
String startDate = getStartDate(qzUserChangeRecord.getStartDate(), firstDayOfMonth);
|
||||
String endDate = getEndDate(qzUserChangeRecord.getEndDate(), lastDayOfMonth);
|
||||
workdays += Convert.toInt(getWorkDays(startDate, endDate, userId), 0);
|
||||
}
|
||||
// 构建拆分后的 po 数据
|
||||
QzSalaryReportPO splitPo = QzSalaryReportBO.splitQzSalaryReportPO(po, workdays, totalWorkDays);
|
||||
int userDepartment = new User(userId).getUserDepartment();
|
||||
poListMap.get(userDepartment).add(splitPo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (QzActualWorkplace qzActualWorkplace : actualWorkplaceList) {
|
||||
List<QzSalaryReportPO> value = poListMap.get(qzActualWorkplace.getWorkplaceId());
|
||||
QzSalaryReportDTO qzSalaryReportDTO = QzSalaryReportBO.toDTO(value);
|
||||
qzSalaryReportDTO.setCompanyName(departmentMap.get(qzActualWorkplace.getDepartmentId()));
|
||||
dtoList.add(qzSalaryReportDTO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
PageInfo<QzSalaryReportDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), dtoList, QzSalaryReportDTO.class);
|
||||
|
||||
// 合计行数据统计
|
||||
QzSalaryReportDTO qzSalaryReportDTO = QzSalaryReportBO.toSumary(dtoList);
|
||||
qzSalaryReportDTO.setCompanyName("合计");
|
||||
returnMap.put("sumary", qzSalaryReportDTO);
|
||||
returnMap.put("pageInfo", pageInfo);
|
||||
returnMap.put("columns", getColumnGroups());
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
private String getStartDate(String startDate, String firstDayOfMonth) {
|
||||
int compDate = DateUtil.compDate(startDate, firstDayOfMonth);
|
||||
if (compDate < 0) {
|
||||
startDate = firstDayOfMonth;
|
||||
}
|
||||
return startDate;
|
||||
}
|
||||
|
||||
private String getEndDate(String endDate, String lastDayOfMonth) {
|
||||
int compDate = DateUtil.compDate(endDate, lastDayOfMonth);
|
||||
if (compDate > 0) {
|
||||
endDate = lastDayOfMonth;
|
||||
} else {
|
||||
endDate = DateUtil.addDate(endDate, -1);
|
||||
}
|
||||
return endDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建薪资项目数据
|
||||
*
|
||||
* @param po
|
||||
* @param salaryItemMap
|
||||
*/
|
||||
private static void buildSalaryReportPO(QzSalaryReportPO po, Map<String, String> salaryItemMap) {
|
||||
po.setBasicSalary(po.getBasicSalary() + Convert.toDouble(salaryItemMap.get("基本工资"), 0.0));
|
||||
po.setPostAllowance(po.getPostAllowance() + Convert.toDouble(salaryItemMap.get("岗位津贴"), 0.0));
|
||||
po.setPerformanceBonus(po.getPerformanceBonus() + Convert.toDouble(salaryItemMap.get("绩效奖金"), 0.0));
|
||||
po.setFullAttendanceSalary(po.getFullAttendanceSalary() + Convert.toDouble(salaryItemMap.get("全勤工资"), 0.0));
|
||||
po.setMonthStandardSalary(po.getMonthStandardSalary() + Convert.toDouble(salaryItemMap.get("月度标准工资"), 0.0));
|
||||
po.setWorkdays(po.getWorkdays() + Convert.toInt(salaryItemMap.get("应出勤天数"), 0));
|
||||
po.setActualMonthSalary(po.getActualMonthSalary() + Convert.toDouble(salaryItemMap.get("实际月薪"), 0.0));
|
||||
po.setSubsidy(po.getSubsidy() + Convert.toDouble(salaryItemMap.get("补贴"), 0.0));
|
||||
po.setCommission(po.getCommission() + Convert.toDouble(salaryItemMap.get("提成"), 0.0));
|
||||
po.setBonus(po.getBonus() + Convert.toDouble(salaryItemMap.get("奖金"), 0.0));
|
||||
po.setPerformanceAssessment(po.getPerformanceAssessment() + Convert.toDouble(salaryItemMap.get("绩效考核"), 0.0));
|
||||
po.setCommissionReserveReturn(po.getCommissionReserveReturn() + Convert.toDouble(salaryItemMap.get("提成预留返还"), 0.0));
|
||||
po.setNotFullAttendanceDeduction(po.getNotFullAttendanceDeduction() + Convert.toDouble(salaryItemMap.get("未全勤扣款"), 0.0));
|
||||
po.setBalance(po.getBalance() + Convert.toDouble(salaryItemMap.get("补差"), 0.0));
|
||||
po.setLeaveDeduction(po.getLeaveDeduction() + Convert.toDouble(salaryItemMap.get("事假扣款"), 0.0));
|
||||
po.setSickLeaveDeduction(po.getSickLeaveDeduction() + Convert.toDouble(salaryItemMap.get("病假扣款"), 0.0));
|
||||
po.setAbsenteeismDeduction(po.getAbsenteeismDeduction() + Convert.toDouble(salaryItemMap.get("旷工扣款"), 0.0));
|
||||
po.setCommissionReserve(po.getCommissionReserve() + Convert.toDouble(salaryItemMap.get("提成预留"), 0.0));
|
||||
po.setExternalRefund(po.getExternalRefund() + Convert.toDouble(salaryItemMap.get("外部退费"), 0.0));
|
||||
po.setOtherDeduction(po.getOtherDeduction() + Convert.toDouble(salaryItemMap.get("其他扣款"), 0.0));
|
||||
po.setLastMonthArrears(po.getLastMonthArrears() + Convert.toDouble(salaryItemMap.get("上月欠款"), 0.0));
|
||||
po.setSubtotal(po.getSubtotal() + Convert.toDouble(salaryItemMap.get("小计"), 0.0));
|
||||
po.setPayableSalary(po.getPayableSalary() + Convert.toDouble(salaryItemMap.get("应发工资"), 0.0));
|
||||
po.setSocialInsurancePaymentSum(po.getSocialInsurancePaymentSum() + Convert.toDouble(salaryItemMap.get("个人社保缴纳合计"), 0.0));
|
||||
po.setPersonalFundPaymentSum(po.getPersonalFundPaymentSum() + Convert.toDouble(salaryItemMap.get("个人公积金缴纳合计"), 0.0));
|
||||
po.setTaxableSalary(po.getTaxableSalary() + Convert.toDouble(salaryItemMap.get("税前工资"), 0.0));
|
||||
po.setThisTimeDeductionTax(po.getThisTimeDeductionTax() + Convert.toDouble(salaryItemMap.get("本次代扣税"), 0.0));
|
||||
po.setDismissalCompensation(po.getDismissalCompensation() + Convert.toDouble(salaryItemMap.get("解聘补偿"), 0.0));
|
||||
po.setAfterTaxSalary(po.getAfterTaxSalary() + Convert.toDouble(salaryItemMap.get("税后工资"), 0.0));
|
||||
po.setActualPaymentSum(po.getActualPaymentSum() + Convert.toDouble(salaryItemMap.get("实发合计(工资代发)"), 0.0));
|
||||
po.setPersonalArrears(po.getPersonalArrears() + Convert.toDouble(salaryItemMap.get("个人欠款"), 0.0));
|
||||
po.setBusinessDepartmentYearPerformance(po.getBusinessDepartmentYearPerformance() + Convert.toDouble(salaryItemMap.get("业务部门年度绩效"), 0.0));
|
||||
po.setAnnualEndowmentSum(po.getAnnualEndowmentSum() + Convert.toDouble(salaryItemMap.get("年终奖合计"), 0.0));
|
||||
po.setCompanySocialInsurancePaymentSum(po.getCompanySocialInsurancePaymentSum() + Convert.toDouble(salaryItemMap.get("单位社保缴纳合计"), 0.0));
|
||||
po.setCompanyFundPaymentSum(po.getCompanyFundPaymentSum() + Convert.toDouble(salaryItemMap.get("单位公积金缴纳合计"), 0.0));
|
||||
po.setArchiveManagementFee(po.getArchiveManagementFee() + Convert.toDouble(salaryItemMap.get("档案管理费"), 0.0));
|
||||
po.setArchiveManagementFeeRepayment(po.getArchiveManagementFeeRepayment() + Convert.toDouble(salaryItemMap.get("档案管理费补缴"), 0.0));
|
||||
po.setServiceFee(po.getServiceFee() + Convert.toDouble(salaryItemMap.get("服务费"), 0.0));
|
||||
po.setServiceFeeRepayment(po.getServiceFeeRepayment() + Convert.toDouble(salaryItemMap.get("服务费补缴"), 0.0));
|
||||
po.setCompanyMonthlyPaymentSum(po.getCompanyMonthlyPaymentSum() + Convert.toDouble(salaryItemMap.get("单位月缴纳合计"), 0.0));
|
||||
po.setCompanyTotalCost(po.getCompanyTotalCost() + Convert.toDouble(salaryItemMap.get("公司总成本"), 0.0));
|
||||
po.setSalaryReimbursement(po.getSalaryReimbursement() + Convert.toDouble(salaryItemMap.get("工资走报销"), 0.0));
|
||||
po.setTotalActualPaymentIncome(po.getTotalActualPaymentIncome() + Convert.toDouble(salaryItemMap.get("员工实发总收入(含报销)"), 0.0));
|
||||
po.setTotalCompanyCost(po.getTotalCompanyCost() + Convert.toDouble(salaryItemMap.get("公司总成本(含报销)"), 0.0));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回指定日志范围内的工作日天数
|
||||
*
|
||||
* @param beginDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @param userid 人员ID
|
||||
* @return
|
||||
*/
|
||||
public String getWorkDays(String beginDate, String endDate, int userid) {
|
||||
BaseBean bean = new BaseBean();
|
||||
//设置日期格式
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//起始日期
|
||||
if (beginDate == null || beginDate.length() == 0) {
|
||||
beginDate = bean.getPropValue("scheduleWorkDayForFormula", "fromDate");
|
||||
beginDate = beginDate == null ? "" : beginDate.trim();
|
||||
if (beginDate.length() == 0) {
|
||||
beginDate = df.format(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
//截止日期
|
||||
if (endDate == null || endDate.length() == 0) {
|
||||
endDate = bean.getPropValue("scheduleWorkDayForFormula", "endDate");
|
||||
endDate = endDate == null ? "" : endDate.trim();
|
||||
if (endDate.length() == 0) {
|
||||
endDate = df.format(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
boolean isBig = false;
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date begin = sdf.parse(beginDate);
|
||||
Date end = sdf.parse(endDate);
|
||||
if (begin.compareTo(end) > 0) {
|
||||
String temp = beginDate;
|
||||
beginDate = endDate;
|
||||
endDate = temp;
|
||||
isBig = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
bean.writeLog("ExcelFormulaWorkday解析日期报错", e);
|
||||
}
|
||||
|
||||
int workDayCount = 0;
|
||||
User user = new User(userid);
|
||||
HrmScheduleManager manager = new HrmScheduleManager(user);
|
||||
Map<String, Boolean> mapWorkday = manager.isWorkday(beginDate, endDate, manager.getSubCompanyId());
|
||||
if (mapWorkday != null && mapWorkday.size() > 0) {
|
||||
Iterator<String> itr = mapWorkday.keySet().iterator();
|
||||
while (itr.hasNext()) {
|
||||
String tempDate = itr.next();
|
||||
Boolean isWorkDay = mapWorkday.get(tempDate);
|
||||
if (isWorkDay) {
|
||||
if (isBig) {
|
||||
workDayCount--;
|
||||
} else {
|
||||
workDayCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return workDayCount + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报表列头
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<WeaTableColumnGroup> getColumnGroups() {
|
||||
List<WeaTableColumnGroup> result = new ArrayList<>();
|
||||
result.add(new WeaTableColumnGroup("150", "所属公司", "companyName"));
|
||||
result.add(new WeaTableColumnGroup("150", "人员数目", "personCount"));
|
||||
result.add(new WeaTableColumnGroup("150", "剔除兼职和离职预留人数", "excludePartTimeAndDismissCount"));
|
||||
result.add(new WeaTableColumnGroup("150", "基本工资", "basicSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "岗位津贴", "postAllowance"));
|
||||
result.add(new WeaTableColumnGroup("150", "绩效奖金", "performanceBonus"));
|
||||
result.add(new WeaTableColumnGroup("150", "全勤工资", "fullAttendanceSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "月标准工资", "monthStandardSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "应出勤天数", "workdays"));
|
||||
result.add(new WeaTableColumnGroup("150", "实际月薪", "actualMonthSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "补贴", "subsidy"));
|
||||
result.add(new WeaTableColumnGroup("150", "提成", "commission"));
|
||||
result.add(new WeaTableColumnGroup("150", "奖金", "bonus"));
|
||||
result.add(new WeaTableColumnGroup("150", "绩效考核", "performanceAssessment"));
|
||||
result.add(new WeaTableColumnGroup("150", "提成预留返还", "commissionReserveReturn"));
|
||||
result.add(new WeaTableColumnGroup("150", "未全勤扣款", "notFullAttendanceDeduction"));
|
||||
result.add(new WeaTableColumnGroup("150", "补差", "balance"));
|
||||
result.add(new WeaTableColumnGroup("150", "事假扣款", "leaveDeduction"));
|
||||
result.add(new WeaTableColumnGroup("150", "病假扣款", "sickLeaveDeduction"));
|
||||
result.add(new WeaTableColumnGroup("150", "旷工扣款", "absenteeismDeduction"));
|
||||
result.add(new WeaTableColumnGroup("150", "提成预留", "commissionReserve"));
|
||||
result.add(new WeaTableColumnGroup("150", "外部退费", "externalRefund"));
|
||||
result.add(new WeaTableColumnGroup("150", "其他扣款", "otherDeduction"));
|
||||
result.add(new WeaTableColumnGroup("150", "上月欠款", "lastMonthArrears"));
|
||||
result.add(new WeaTableColumnGroup("150", "小计", "subtotal"));
|
||||
result.add(new WeaTableColumnGroup("150", "应发工资", "payableSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "个人社保缴纳合计", "socialInsurancePaymentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "个人公积金缴纳合计", "personalFundPaymentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "税前工资", "taxableSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "本次代扣税", "thisTimeDeductionTax"));
|
||||
result.add(new WeaTableColumnGroup("150", "解聘补偿", "dismissalCompensation"));
|
||||
result.add(new WeaTableColumnGroup("150", "税后工资", "afterTaxSalary"));
|
||||
result.add(new WeaTableColumnGroup("150", "实发合计(工资代发)", "actualPaymentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "个人欠款", "personalArrears"));
|
||||
result.add(new WeaTableColumnGroup("150", "业务部门年度绩效", "businessDepartmentYearPerformance"));
|
||||
result.add(new WeaTableColumnGroup("150", "年终奖合计", "annualEndowmentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "单位社保缴纳合计", "companySocialInsurancePaymentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "单位公积金缴纳合计", "companyPersonalFundPaymentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "档案管理费", "archiveManagementFee"));
|
||||
result.add(new WeaTableColumnGroup("150", "档案管理费补缴", "archiveManagementFeeRepayment"));
|
||||
result.add(new WeaTableColumnGroup("150", "服务费", "serviceFee"));
|
||||
result.add(new WeaTableColumnGroup("150", "服务费补缴", "serviceFeeRepayment"));
|
||||
result.add(new WeaTableColumnGroup("150", "单位月缴纳合计", "companyMonthlyPaymentSum"));
|
||||
result.add(new WeaTableColumnGroup("150", "公司总成本", "companyTotalCost"));
|
||||
result.add(new WeaTableColumnGroup("150", "工资走报销", "salaryReimbursement"));
|
||||
result.add(new WeaTableColumnGroup("150", "员工实发总收入(含报销)", "totalActualPaymentIncome"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.qzreport.param.QzSalaryReportParam;
|
||||
import com.engine.salary.service.QzSalaryReportService;
|
||||
import com.engine.salary.service.impl.QzSalaryReportServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/12/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class QzSalaryReportWrapper extends Service {
|
||||
private QzSalaryReportService getQzSalaryReportService(User user) {
|
||||
return ServiceUtil.getService(QzSalaryReportServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> getSalaryReport(QzSalaryReportParam queryParam) {
|
||||
return getQzSalaryReportService(user).getSalaryReport(queryParam);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue