Commit e443f6e4 authored by hongguangwu's avatar hongguangwu

MVP1.5.1-收入证明等

parent 618ebc2a
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 报账详情合计金额vo
*
* @author hgw
* @date 2023-2-23 15:22:33
*/
@Data
@Schema(description = "报账详情合计金额vo")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryAccountSumVo {
@ExcelProperty("应发合计")
private BigDecimal relaySalary;
@ExcelProperty("实发合计")
private BigDecimal actualSalary;
@ExcelProperty("个税合计")
private BigDecimal salaryTax;
@ExcelProperty("年终奖金额合计")
private BigDecimal annualBonus;
@ExcelProperty("年终奖扣税合计")
private BigDecimal annualBonusTax;
@ExcelProperty("社保合计")
private BigDecimal allSocial;
@ExcelProperty("公积金合计")
private BigDecimal allFund;
@ExcelProperty("单位社保合计")
private BigDecimal unitSocial;
@ExcelProperty("单位公积金合计")
private BigDecimal unitFund;
@ExcelProperty("个人社保合计")
private BigDecimal personSocial;
@ExcelProperty("个人公积金合计")
private BigDecimal personFund;
@ExcelProperty("企业年金")
private BigDecimal allEnterpriseAnnuity;
@ExcelProperty("个人年金合计")
private BigDecimal enterpriseAnnuity;
@ExcelProperty("单位年金合计")
private BigDecimal enterpriseAnnuityUnit;
}
......@@ -38,4 +38,6 @@ public class TSalaryDetailVo implements Serializable {
*/
private List<TSalaryStandardIssueRes> resList = new ArrayList<>();
private TSalaryAccountSumVo salarySum = new TSalaryAccountSumVo(); //工资主表合计金额
}
......@@ -182,4 +182,6 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
List<String> getAccountMonthForProve(@Param("startMouth") String startMouth, @Param("endMouth") String endMouth
, @Param("emIdCard") String emIdCard, @Param("settleDepartId") String settleDepartId);
TSalaryAccountSumVo getAccountSumBySalaryId(@Param("salaryId") String salaryId);
}
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAccountAndItemVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SettlementFormVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSumVo;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
......@@ -196,5 +197,12 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
// 收入证明使用的
List<String> getAccountIdForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId);
List<String> getAccountMonthForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId);
/**
* @param salaryId
* @Description: 薪资详情里的金额合计
* @Author: hgw
* @Date: 2023/2/23 15:36
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSumVo
**/
TSalaryAccountSumVo getAccountSumBySalaryId(String salaryId);
}
......@@ -1408,6 +1408,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryStandardIssueRes> resList = tSalaryStandardIssueResService.list(
Wrappers.<TSalaryStandardIssueRes>query().lambda().eq(TSalaryStandardIssueRes::getSalaryId, salary.getId()));
salaryDetailVo.setResList(resList);
salaryDetailVo.setSalarySum(tSalaryAccountService.getAccountSumBySalaryId(salaryFormId));
}
salaryDetailVo.setAttaList(attaList);
salaryDetailVo.setAuditLogList(auditLogService.list(Wrappers.<TApprovalRecord>query().lambda().eq(TApprovalRecord::getSalaryId, salary.getId())));
......
......@@ -374,4 +374,9 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
public List<String> getAccountMonthForProve(String startMouth, String endMouth, String emIdCard, String settleDepartId) {
return baseMapper.getAccountMonthForProve(startMouth, endMouth, emIdCard, settleDepartId);
}
@Override
public TSalaryAccountSumVo getAccountSumBySalaryId(String salaryId) {
return baseMapper.getAccountSumBySalaryId(salaryId);
}
}
......@@ -1153,4 +1153,27 @@
AND PERIOD_DIFF(#{endMouth}, a.SALARY_MONTH) >= 0
group by a.SALARY_MONTH
</select>
<select id="getAccountSumBySalaryId" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSumVo">
select
sum(a.RELAY_SALARY) RELAY_SALARY
,sum(a.ACTUAL_SALARY) ACTUAL_SALARY
,sum(a.SALARY_TAX) SALARY_TAX
,sum(ifnull(annualBonus.SALARY_MONEY,0)) annual_Bonus
,sum(ifnull(a.ANNUAL_BONUS_TAX,0)) ANNUAL_BONUS_TAX
,sum(ifnull(a.UNIT_SOCIAL,0))+sum(ifnull(a.PERSON_SOCIAL,0)) ALL_SOCIAL
,sum(ifnull(a.UNIT_FUND,0))+sum(ifnull(a.PERSON_FUND,0)) ALL_FUND
,sum(ifnull(a.UNIT_SOCIAL,0)) UNIT_SOCIAL
,sum(ifnull(a.UNIT_FUND,0)) UNIT_FUND
,sum(ifnull(a.PERSON_SOCIAL,0)) PERSON_SOCIAL
,sum(ifnull(a.PERSON_FUND,0)) PERSON_FUND
,sum(ifnull(enterpriseAnnuity.SALARY_MONEY,0))+sum(ifnull(enterpriseAnnuityUnit.SALARY_MONEY,0)) ALL_enterprise_Annuity
,sum(ifnull(enterpriseAnnuity.SALARY_MONEY,0)) enterprise_Annuity
,sum(ifnull(enterpriseAnnuityUnit.SALARY_MONEY,0)) enterprise_Annuity_Unit
from t_salary_account a
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item enterpriseAnnuityUnit on enterpriseAnnuityUnit.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuityUnit.JAVA_FIED_NAME='enterpriseAnnuityUnit'
where a.DELETE_FLAG='0' and a.SALARY_FORM_ID = #{salaryId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment