Commit 7d4be61f authored by hongguangwu's avatar hongguangwu

MVP1.6.3-工资原表导出

parent 23ea397d
......@@ -599,4 +599,12 @@ public class TSalaryAccount extends BaseEntity {
@ExcelProperty(value = "导入行号")
private Integer rowIndex;
// 额外给前端导出使用的
@TableField(exist = false)
@ExcelProperty("企业(职业)年金")
private String enterpriseAnnuity;
@TableField(exist = false)
@ExcelProperty("个人代扣金额")
private String pdeductionMoney;
}
......@@ -19,17 +19,15 @@ package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
......@@ -59,10 +57,10 @@ public class TSalaryAccountExportByEkpVo {
private String empIdcard;
@ExcelProperty("手机号码")
private String empPhone;
// TODO
// 银行卡号
@ExcelProperty("银行卡号")
private String bankNo;
// TODO
// 开户行总行
@ExcelProperty("开户行总行")
private String bankName;
// ,应发工资,个人社保,个人公积金,个税,年终奖单独扣税税费,企业(职业)年金,个人代扣金额,个人实发合计,单位社保,单位公积金
......@@ -103,57 +101,57 @@ public class TSalaryAccountExportByEkpVo {
private BigDecimal sumBabyMoney;
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
// TODO 年终奖扣税方案0:合并;1:单独
// 年终奖扣税方案0:合并;1:单独
@ExcelProperty("年终奖扣税方案")
private String annualBonusType;
// TODO
// 开户行省
@ExcelProperty("开户行省")
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// TODO
// 开户行市
@ExcelProperty("开户行市")
private String bankCity;
// TODO
// 开户行支行
@ExcelProperty("开户行支行")
private String bankSubName;
// TODO 工资发放方式(0现金/1银行)/2线下
// 工资发放方式(0现金/1银行)/2线下
@ExcelProperty("工资发放方式")
private String salaryStyle;
// TODO 工资发放时间(0立即发、1暂停发)
// 工资发放时间(0立即发、1暂停发)
@ExcelProperty("工资发放时间")
private String salaryGiveTime;
// TODO
// 社保缴纳月份
@ExcelProperty("社保缴纳月份")
private String deduSocialMonth;
// TODO
// 公积金缴纳月份
@ExcelProperty("公积金缴纳月份")
private String deduProvidentMonth;
// TODO 社保优先级0:生成月;1:缴纳月
// 社保优先级0:生成月;1:缴纳月
@ExcelProperty("社保优先级")
private String socialPriority;
// TODO 公积金优先级0:生成月;1:缴纳月
// 公积金优先级0:生成月;1:缴纳月
@ExcelProperty("公积金优先级")
private String fundPriority;
// TODO 是否扣除社保 0:否,1:是
// 是否扣除社保 0:否,1:是
@ExcelProperty("是否扣除社保")
private String isDeductSocial;
// TODO 是否扣除公积金 0:否,1:是
// 是否扣除公积金 0:否,1:是
@ExcelProperty("是否扣除公积金")
private String isDeductFund;
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// TODO 本月是否重复金额0:否;1:是重复导入的
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
private String isRepeat;
// TODO 是否自有员工0:否;1:是自有员工
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
private String ownFlag;
// TODO 是否含有特殊金额
// 是否含有特殊金额
@ExcelProperty("是否薪资特殊值")
private Integer haveSpecialFlag;
private String haveSpecialFlag;
@ExcelProperty("支出结算状态")
private String paySettleFlag;
@ExcelProperty("免个税个人代扣")
/*@ExcelProperty("免个税个人代扣")
private BigDecimal exemptionPersionTax;
@ExcelProperty("是否劳务费")
private String formType;
......@@ -178,6 +176,6 @@ public class TSalaryAccountExportByEkpVo {
@ExcelProperty("结算单位")
private String unitName;
@ExcelProperty("结算单位编码")
private String unitNo;
private String unitNo;*/
}
......@@ -102,6 +102,87 @@
<result property="isDiff" column="IS_DIFF"/>
</resultMap>
<resultMap id="tSalaryAccountWebExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
<id property="id" column="ID"/>
<result property="invoiceTitle" column="INVOICE_TITLE"/>
<result property="salaryFormId" column="SALARY_FORM_ID"/>
<result property="salaryMonth" column="SALARY_MONTH"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="bankNo" column="BANK_NO"/>
<result property="bankName" column="BANK_NAME"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="salaryStyle" column="SALARY_STYLE"/>
<result property="salaryGiveTime" column="SALARY_GIVE_TIME"/>
<result property="distributionFlag" column="DISTRIBUTION_FLAG"/>
<result property="deduSocialMonth" column="DEDU_SOCIAL_MONTH"/>
<result property="deduProvidentMonth" column="DEDU_PROVIDENT_MONTH"/>
<result property="formType" column="FORM_TYPE"/>
<result property="settlementMonth" column="SETTLEMENT_MONTH"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="socialPriority" column="SOCIAL_PRIORITY"/>
<result property="fundPriority" column="FUND_PRIORITY"/>
<result property="annualBonusType" column="ANNUAL_BONUS_TYPE"/>
<result property="taxMonth" column="TAX_MONTH"/>
<result property="isDeductSocial" column="IS_DEDUCT_SOCIAL"/>
<result property="isDeductFund" column="IS_DEDUCT_FUND"/>
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="town" column="TOWN"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="ownFlag" column="OWN_FLAG"/>
<result property="isRepeat" column="IS_REPEAT"/>
<result property="bankSubName" column="BANK_SUB_NAME"/>
<result property="bankProvince" column="BANK_PROVINCE"/>
<result property="bankCity" column="BANK_CITY"/>
<result property="isPersonTax" column="IS_PERSON_TAX"/>
<result property="relaySalary" column="RELAY_SALARY"/>
<result property="actualSalary" column="ACTUAL_SALARY"/>
<result property="salaryTax" column="SALARY_TAX"/>
<result property="relaySalaryUnit" column="RELAY_SALARY_UNIT"/>
<result property="salaryTaxUnit" column="SALARY_TAX_UNIT"/>
<result property="haveSalaryFlag" column="HAVE_SALARY_FLAG"/>
<result property="haveSpecialFlag" column="HAVE_SPECIAL_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="sendStatus" column="SEND_STATUS"/>
<result property="sendTime" column="SEND_TIME"/>
<result property="sendUser" column="SEND_USER"/>
<result property="sendUserName" column="SEND_USER_NAME"/>
<result property="sendMonth" column="SEND_MONTH"/>
<result property="orderId" column="ORDER_ID"/>
<result property="unitSocial" column="UNIT_SOCIAL"/>
<result property="personSocial" column="PERSON_SOCIAL"/>
<result property="unitFund" column="UNIT_FUND"/>
<result property="personFund" column="PERSON_FUND"/>
<result property="costReduction" column="COST_REDUCTION"/>
<result property="annualBonusTax" column="ANNUAL_BONUS_TAX"/>
<result property="sumChildEduMoney" column="SUM_CHILD_EDU_MONEY"/>
<result property="sumHousingLoanMoney" column="SUM_HOUSING_LOAN_MONEY"/>
<result property="sumHousingRentMoney" column="SUM_HOUSING_RENT_MONEY"/>
<result property="sumSupportElderlyMoney" column="SUM_SUPPORT_ELDERLY_MONEY"/>
<result property="sumContinuingEducationMoney" column="SUM_CONTINUING_EDUCATION_MONEY"/>
<result property="sumBabyMoney" column="SUM_BABY_MONEY"/>
<result property="sumPrivatePension" column="SUM_PRIVATE_PENSION"/>
<result property="incomeSettleFlag" column="INCOME_SETTLE_FLAG"/>
<result property="incomeCollectFlag" column="INCOME_COLLECT_FLAG"/>
<result property="paySettleFlag" column="PAY_SETTLE_FLAG"/>
<result property="payCollectFlag" column="PAY_COLLECT_FLAG"/>
<result property="isDiff" column="IS_DIFF"/>
<result property="enterpriseAnnuity" column="ENTERPRISE_ANNUITY"/>
<result property="pdeductionMoney" column="PDEDUCTION_MONEY"/>
</resultMap>
<!-- B端薪酬第一个统计列表 -->
<resultMap id="settlementFormVoMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.SettlementFormVo">
<result property="salaryMonth" column="SALARY_MONTH"/>
......@@ -871,73 +952,84 @@
</select>
<select id="getAccountListBySalaryId" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
<select id="getAccountListBySalaryId" resultMap="tSalaryAccountWebExportMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
SELECT
<include refid="Base_Column_List"/>
,enterpriseAnnuity.SALARY_MONEY as ENTERPRISE_ANNUITY
,sum(ifnull(pdeduction.SALARY_MONEY,0)) PDEDUCTION_MONEY
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
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 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
left join t_salary_account_item_hro_2021 enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item_hro_2021 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
</if>
where a.SALARY_FORM_ID = #{searchVo.salaryFormId}
ORDER BY a.ROW_INDEX ASC
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo">
select
case a.FORM_TYPE when '0' then '薪资' when '1' then '绩效' when '3' then '劳务费' when '4' then '稿酬' else '其他' end as formType,
a.EMP_PHONE as empPhone,
a.TAX_MONTH as taxMonth,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.INVOICE_TITLE as invoiceTitle,
a.UNIT_NAME as unitName,
a.UNIT_NO as unitNo,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
if(a.RELAY_SALARY_UNIT is not null and a.RELAY_SALARY_UNIT != 0, a.RELAY_SALARY_UNIT, ifnull(a.RELAY_SALARY,0)) as relaySalary,
a.ACTUAL_SALARY as actualSalary,
annualBonus.SALARY_MONEY as annualBonus,
ifnull(a.SALARY_TAX,0) + ifnull(a.SALARY_TAX_UNIT,0) as salaryTax,
a.ANNUAL_BONUS_TAX as annualBonusTax,
a.PERSON_SOCIAL as personSocial,
a.PERSON_FUND as personFund,
exemptionPersionTax.SALARY_MONEY as exemptionPersionTax,
enterpriseAnnuity.SALARY_MONEY as enterpriseAnnuity,
a.UNIT_SOCIAL as unitSocial,
a.UNIT_FUND as unitFund,
a.SUM_BABY_MONEY as sumBabyMoney,
a.SUM_CHILD_EDU_MONEY as sumChildEduMoney,
a.SUM_CONTINUING_EDUCATION_MONEY as sumContinuingEducationMoney,
a.SUM_HOUSING_LOAN_MONEY as sumHousingLoanMoney,
a.SUM_HOUSING_RENT_MONEY as sumHousingRentMoney,
a.SUM_PRIVATE_PENSION as sumPrivatePension,
a.SUM_SUPPORT_ELDERLY_MONEY as sumSupportElderlyMoney,
a.COST_REDUCTION as costReduction,
a.CREATE_NAME as createName,
GROUP_CONCAT(pdeduction.CN_NAME,':',pdeduction.SALARY_MONEY SEPARATOR ';') pdeductionDetail,
sum(ifnull(pdeduction.SALARY_MONEY,0)) pdeductionMoney,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag,
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,phoneSubsidy.SALARY_MONEY as phoneSubsidy
,s.BUSINESS_PRIMARY_TYPE as businessPrimaryType
,s.BUSINESS_SECOND_TYPE as businessSecondType
,s.BUSINESS_THIRD_TYPE as businessThirdType
a.EMP_PHONE as empPhone,
a.TAX_MONTH as taxMonth,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
if(a.RELAY_SALARY_UNIT is not null and a.RELAY_SALARY_UNIT != 0, a.RELAY_SALARY_UNIT, ifnull(a.RELAY_SALARY,0)) as relaySalary,
a.ACTUAL_SALARY as actualSalary,
ifnull(a.SALARY_TAX,0) + ifnull(a.SALARY_TAX_UNIT,0) as salaryTax,
a.ANNUAL_BONUS_TAX as annualBonusTax,
a.PERSON_SOCIAL as personSocial,
a.PERSON_FUND as personFund,
enterpriseAnnuity.SALARY_MONEY as enterpriseAnnuity,
a.UNIT_SOCIAL as unitSocial,
a.UNIT_FUND as unitFund,
a.SUM_BABY_MONEY as sumBabyMoney,
a.SUM_CHILD_EDU_MONEY as sumChildEduMoney,
a.SUM_CONTINUING_EDUCATION_MONEY as sumContinuingEducationMoney,
a.SUM_HOUSING_LOAN_MONEY as sumHousingLoanMoney,
a.SUM_HOUSING_RENT_MONEY as sumHousingRentMoney,
a.SUM_PRIVATE_PENSION as sumPrivatePension,
a.SUM_SUPPORT_ELDERLY_MONEY as sumSupportElderlyMoney,
a.COST_REDUCTION as costReduction,
sum(ifnull(pdeduction.SALARY_MONEY,0)) pdeductionMoney,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag,
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,a.BANK_NO as bankNo
,a.BANK_NAME as bankName
,if(a.ANNUAL_BONUS_TYPE='1','单独','合并') as annualBonusType
,ap.AREA_NAME as bankProvince
,ac.AREA_NAME as bankCity
,a.BANK_SUB_NAME as bankSubName
,if(a.SALARY_STYLE='0','现金','银行') as salaryStyle
,if(a.SALARY_GIVE_TIME='1','暂停发','立即发') as salaryGiveTime
,a.DEDU_SOCIAL_MONTH as deduSocialMonth
,a.DEDU_PROVIDENT_MONTH as deduProvidentMonth
,if(a.SOCIAL_PRIORITY='1','缴纳月','生成月') as socialPriority
,if(a.FUND_PRIORITY='1','缴纳月','生成月') as fundPriority
,if(a.IS_DEDUCT_SOCIAL='0','否','是') as isDeductSocial
,if(a.IS_DEDUCT_FUND='0','否','是') as isDeductFund
,if(a.IS_REPEAT='0','否','是') as isRepeat
,if(a.OWN_FLAG='0','否','是') as ownFlag
,if(a.HAVE_SPECIAL_FLAG='0','否','是') haveSpecialFlag
from
t_salary_account a
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
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 exemptionPersionTax on exemptionPersionTax.SALARY_ACCOUNT_ID = a.id and exemptionPersionTax.JAVA_FIED_NAME='exemptionPersionTax'
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 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join t_salary_account_item phoneSubsidy on phoneSubsidy.SALARY_ACCOUNT_ID = a.id and phoneSubsidy.JAVA_FIED_NAME='phoneSubsidy'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0
ORDER BY a.ROW_INDEX ASC
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 计算收入需要的报账明细 -->
......
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