Commit b40b0413 authored by hongguangwu's avatar hongguangwu

MVP1.4导出-项目薪资+个税申报

parent 490e40c5
......@@ -21,8 +21,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 统计-本期申报
*
......@@ -51,4 +57,12 @@ public interface TStatisticsCurrentReportMapper extends BaseMapper<TStatisticsCu
**/
int deleteByYearMonth(@Param("yearMonth") String yearMonth);
/**
* @Description: 导出
* @Author: hgw
* @Date: 2023/1/16 17:44
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport>
**/
List<TStatisticsCurrentReport> getCurrentReportExport(@Param("tStatisticsCurrentReport") TStatisticsCurrentReportSearchVo tStatisticsCurrentReport, @Param("idList")List<String> idList);
}
......@@ -140,29 +140,22 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, TSalaryStandardExportVo.class).build();
int index = 0;
WriteSheet writeSheet;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT_3) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT_3);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TSalaryStandardExportVo> util = new ExcelUtil<>(TSalaryStandardExportVo.class);
for (TSalaryStandardExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
writeSheet = EasyExcelFactory.writerSheet("项目薪酬表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -32,6 +33,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsCurrentReportMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportSearchVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -81,34 +84,24 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsCurrentReport.class).includeColumnFiledNames(searchVo.getExportFields()).build();
ExcelWriter excelWriter = EasyExcelFactory.write(out, TStatisticsCurrentReport.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0;
WriteSheet writeSheet;
if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
ExcelUtil<TStatisticsCurrentReport> util;
for (int i = 0; i <= count; ) {
for (int i = 0; i <= count; i = i + CommonConstants.EXCEL_EXPORT_LIMIT_3) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT_3);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
util = new ExcelUtil<>(TStatisticsCurrentReport.class);
for (TStatisticsCurrentReport vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet("本期申报" + index).build();
writeSheet = EasyExcelFactory.writerSheet("本期申报" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("本期申报" + index).build();
writeSheet = EasyExcelFactory.writerSheet("本期申报" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......@@ -129,16 +122,8 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
}
}
private List<TStatisticsCurrentReport> noPageDiy(TStatisticsCurrentReportSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsCurrentReport> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TStatisticsCurrentReport::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
return baseMapper.selectList(wrapper);
private List<TStatisticsCurrentReport> noPageDiy(TStatisticsCurrentReportSearchVo tStatisticsCurrentReport) {
return baseMapper.getCurrentReportExport(tStatisticsCurrentReport, Common.getList(tStatisticsCurrentReport.getIds()));
}
private Long noPageCountDiy(TStatisticsCurrentReportSearchVo searchVo) {
......
......@@ -350,7 +350,7 @@
<!--tSalaryStandard简单分页查询-->
<select id="getSalaryStandardExport" resultMap="salaryStandardExportMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo">
SELECT
a.STATUS,
case a.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '发送成功' when 5 then '审核不通过' when 6 then '确认不通过' when 10 then '发送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' end as STATUS,
a.SEND_MONTH,
a.DEPT_NAME,
a.DEPT_NO,
......@@ -364,7 +364,7 @@
a.INVOICE_TITLE,
a.CREATE_NAME,
a.SALARY_MONTH,
a.FORM_TYPE,
case a.FORM_TYPE when 0 then '薪资' when 1 then '绩效' when 2 then '其他' when 3 then '劳务费' when 4 then '稿酬' end as FORM_TYPE,
a.CREATE_TIME
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
......
......@@ -275,4 +275,55 @@
DELETE FROM t_statistics_current_report WHERE DECLARE_MONTH = #{yearMonth}
</delete>
<!--导出-->
<select id="getCurrentReportExport" resultMap="tStatisticsCurrentReportMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsCurrentReportSearchVo">
SELECT
a.id,
a.INVOICE_TITLE,
a.SETTLE_DEPART_ID,
a.SETTLE_DEPART_NO,
a.SETTLE_DEPART_NAME,
a.declare_MONTH,
a.EMP_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.cost_reduction,
a.child_eduInfo_money,
a.housing_rentalInfo_money,
a.housing_loan_Interest_expense_money,
a.support_elderly_expense_money,
a.continuing_education_expense_money,
a.REAL_SALARY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_SOCIAL,
a.PERSONAL_PROVIDENT_FEE,
a.enterprise_annuity,
a.taxable,
a.tax_fee,
a.QUICK_DEDUCATION,
a.salary_tax,
a.UNIT_ID,
a.UNIT_NO,
a.UNIT_NAME,
a.SPECIAL_DEDU_MONEY,
a.sum_baby_money,
a.SUM_PRIVATE_PENSION,
if(a.IS_NEW_EMPLOYEE ='0','否','是') IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
FROM t_statistics_current_report a
<where>
1=1
<include refid="tStatisticsCurrentReport_where"/>
</where>
order by a.DECLARE_MONTH desc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
limit #{searchVo.limitStart},#{searchVo.limitEnd}
</if>
</if>
</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