Commit 78402c97 authored by fangxinjiang's avatar fangxinjiang

20240523 HRO 稿酬、劳务费 套表导出

parent f57084a4
/*
* 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 com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryTypeFourExportEkpVo {
//薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// 开户行省,开户行市,开户行支行,稿酬,个税,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
@ExcelProperty("薪酬状态")
private String status;
@ExcelProperty("项目名称")
private String deptName;
@ExcelProperty("项目编码")
private String deptNo;
@ExcelProperty("发放月份")
private String settlementMonth;
@ExcelProperty("薪酬月份")
private String salaryMonth;
@ExcelProperty("员工姓名")
private String empName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("手机号码")
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
private String bankName;
// 开户行省
@ExcelProperty("开户行省")
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
private String bankSubName;
// 劳务费 应发薪酬(劳务费、稿酬)
@ExcelProperty("稿酬")
private String relaySalary;
/**
* 个税金额(个人承担)
*/
@ExcelProperty("个税")
private BigDecimal salaryTax;
/**
* 实发(个人实收)
*/
@ExcelProperty("个人实收")
private BigDecimal actualSalary;
//稿酬,个税,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
private String ownFlag;
//劳务费、稿酬是否含有发薪0:否;1:是
@ExcelProperty("是否发薪员工")
private String haveSalaryFlag;
@ExcelProperty("支出结算状态")
private String paySettleFlag;
}
/*
* 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 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 java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryTypeThreeExportEkpVo {
//薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// 开户行省,开户行市,开户行支行,劳务费,工资发放时间,是否个人承担部分税费
// 个税-个人承担,个税-单位承担,公司应发,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
@ExcelProperty("薪酬状态")
private String status;
@ExcelProperty("项目名称")
private String deptName;
@ExcelProperty("项目编码")
private String deptNo;
@ExcelProperty("发放月份")
private String settlementMonth;
@ExcelProperty("薪酬月份")
private String salaryMonth;
@ExcelProperty("员工姓名")
private String empName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("手机号码")
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
private String bankName;
// 开户行省
@ExcelProperty("开户行省")
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
private String bankSubName;
// 劳务费 应发薪酬(劳务费、稿酬)
@ExcelProperty("劳务费")
private String relaySalary;
// 工资发放时间(0立即发、1暂停发)
@ExcelProperty("工资发放时间")
private String salaryGiveTime;
/**
* 是否个人承担部分税费
* 公司承担全部税费0
* 个人承担部分税费1
* 个人承担全部税费2
*/
@ExcelProperty("是否个人承担部分税费")
private String isPersonTax;
/**
* 个税金额(个人承担)
*/
@ExcelProperty("个税-个人承担")
private BigDecimal salaryTax;
/**
* 个税-单位承担
*/
@ExcelProperty("个税-单位承担")
private BigDecimal salaryTaxUnit;
/**
* 公司应发
*/
@ExcelProperty("公司应发")
private BigDecimal relaySalaryUnit;
/**
* 实发(个人实收)
*/
@ExcelProperty("个人实收")
private BigDecimal actualSalary;
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
private String ownFlag;
//劳务费、稿酬是否含有发薪0:否;1:是
@ExcelProperty("是否发薪员工")
private Integer haveSalaryFlag;
@ExcelProperty("支出结算状态")
private String paySettleFlag;
}
......@@ -197,4 +197,7 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/
List<TSalaryAccount> allYearExport(@Param("tSalaryAccount") TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo);
List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo);
}
......@@ -213,4 +213,8 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
TSalaryAccountSumVo getAccountSumBySalaryId(String salaryId);
List<TSalaryAccount> allYearExport(TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo);
List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo);
}
......@@ -396,4 +396,14 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
public List<TSalaryAccount> allYearExport(TSalaryAccountSearchVo tSalaryAccount) {
return baseMapper.allYearExport(tSalaryAccount);
}
@Override
public List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo) {
return baseMapper.getAccountThreeListByApplyNo(applyNo);
}
@Override
public List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo) {
return baseMapper.getAccountFourListByApplyNo(applyNo);
}
}
......@@ -30,14 +30,19 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAttaMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeFourExportEkpVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeThreeExportEkpVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -291,15 +296,49 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
* @Date: 2024/4/18 17:05
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo
**/
@Async
@Override
public synchronized SalaryAttaVo getSalaryAccountToExcel(String applyNo) {
SalaryAttaVo returnVo = new SalaryAttaVo();
TSalaryStandard standard = tSalaryStandardService.getOne(Wrappers.<TSalaryStandard>query().lambda()
.eq(TSalaryStandard::getApplyNo,applyNo).last(CommonConstants.LAST_ONE_SQL));
// 默认薪资
String formType = CommonConstants.ZERO_STRING;
String preFileName = "薪资";
if (Common.isNotNull(standard)){
formType = standard.getFormType();
}
//薪资
if (CommonConstants.ZERO_STRING.equals(formType)){
List<TSalaryAccountExportByEkpVo> accountList = tSalaryAccountService.getAccountListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryAccountExportByEkpVo.class);
}
}
//劳务费
if (CommonConstants.THREE_STRING.equals(formType)){
List<TSalaryTypeThreeExportEkpVo> accountList = tSalaryAccountService.getAccountThreeListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryTypeThreeExportEkpVo.class);
}
}
//稿酬
if (CommonConstants.FOUR_STRING.equals(formType)){
List<TSalaryTypeFourExportEkpVo> accountList = tSalaryAccountService.getAccountFourListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryTypeFourExportEkpVo.class);
}
}
return returnVo;
}
private <T> SalaryAttaVo getSalaryAttaVo(String applyNo, SalaryAttaVo returnVo, String preFileName, List<T> accountList,Class<T> tClass) {
String filePath = "salaryAccountFile";
String fileName = "薪资报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String fileName = preFileName + "报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String key = filePath + "/" + fileName;
EasyExcelFactory.write(filePath, TSalaryAccountExportByEkpVo.class).sheet("薪资报表生成").doWrite(accountList);
;
EasyExcelFactory.write(filePath, tClass).sheet(preFileName + "报表生成").doWrite(accountList);
try {
File file = new File(filePath);
InputStream inputStream = new FileInputStream(file);
......@@ -329,8 +368,7 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
e.printStackTrace();
}
}
}
return returnVo;
return null;
}
}
......@@ -1409,4 +1409,80 @@
order by a.SALARY_MONTH desc
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountThreeListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeThreeExportEkpVo">
select
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.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
a.EMP_PHONE as empPhone,
a.BANK_NO as bankNo,
a.BANK_NAME as bankName,
ap.AREA_NAME as bankProvince,
ac.AREA_NAME as bankCity,
a.BANK_SUB_NAME as bankSubName,
a.RELAY_SALARY as relaySalary,
if(a.SALARY_GIVE_TIME='1','暂停发','立即发') as salaryGiveTime,
if(a.IS_PERSON_TAX='1','个人承担部分税费',if(a.IS_PERSON_TAX='2','个人承担全部税费','公司承担全部税费')) as isPersonTax,
a.SALARY_TAX as salaryTax,
a.SALARY_TAX_UNIT as salaryTaxUnit,
a.RELAY_SALARY_UNIT as relaySalaryUnit,
a.ACTUAL_SALARY as actualSalary,
if(a.IS_REPEAT='0','否','是') as isRepeat,
if(a.OWN_FLAG='0','否','是') as ownFlag,
if(a.HAVE_SALARY_FLAG='0','否','是') as haveSalaryFlag,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag
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 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 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
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountFourListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeFourExportEkpVo">
select
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.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
a.EMP_PHONE as empPhone,
a.BANK_NO as bankNo,
a.BANK_NAME as bankName,
ap.AREA_NAME as bankProvince,
ac.AREA_NAME as bankCity,
a.BANK_SUB_NAME as bankSubName,
a.RELAY_SALARY as relaySalary,
a.SALARY_TAX as salaryTax,
a.ACTUAL_SALARY as actualSalary,
if(a.IS_REPEAT='0','否','是') as isRepeat,
if(a.OWN_FLAG='0','否','是') as ownFlag,
if(a.HAVE_SALARY_FLAG='0','否','是') as haveSalaryFlag,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag
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 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 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
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</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