Commit 4a6ced87 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.4-EXPORT' into MVP1.4-EXPORT

parents 0e86c87b 855b0ee2
...@@ -510,4 +510,19 @@ public class TEmployeeContractInfo extends BaseEntity { ...@@ -510,4 +510,19 @@ public class TEmployeeContractInfo extends BaseEntity {
@ExcelAttribute(name = "减少原因") @ExcelAttribute(name = "减少原因")
@Schema(description = "减少原因") @Schema(description = "减少原因")
private String reduceReason; private String reduceReason;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
@TableField(exist = false)
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
@TableField(exist = false)
private int limitEnd;
} }
...@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportAuditVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportAuditVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -50,8 +49,13 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac ...@@ -50,8 +49,13 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
List<TEmployeeContractInfo> getTEmployeeContractList(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo); List<TEmployeeContractInfo> getTEmployeeContractList(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo);
List<EmployeeContractExportVO> getTEmployeeContractExport(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo); List<EmployeeContractExportVO> getTEmployeeContractExport(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo);
Integer selectCountContractExport(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo);
List<EmployeeContractExportVO> getTEmployeeContractExportHistory(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo); List<EmployeeContractExportVO> getTEmployeeContractExportHistory(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo);
Integer selectCountHistoryContractExport(@Param("tEmployeeContractInfo") TEmployeeContractInfo tEmployeeContractInfo);
TEmployeeContractInfo getOneContractByApplyNo(@Param("applyNo") String applyNo); TEmployeeContractInfo getOneContractByApplyNo(@Param("applyNo") String applyNo);
/** /**
......
...@@ -1130,11 +1130,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1130,11 +1130,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) { if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) {
String fileName = "员工合同批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = "员工合同批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表 //获取要导出的列表
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExport(contractInfo); List<EmployeeContractExportVO> list = new ArrayList<>();
ServletOutputStream out = null; ServletOutputStream out = null;
if (list == null || list.isEmpty()) { Integer count = baseMapper.selectCountContractExport(contractInfo);
list = new ArrayList<>();
}
try { try {
ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class); ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class);
out = response.getOutputStream(); out = response.getOutputStream();
...@@ -1149,8 +1147,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1149,8 +1147,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class) ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap))
.includeColumnFieldNames(contractInfo.getExportFields()).build(); .includeColumnFieldNames(contractInfo.getExportFields()).build();
WriteSheet writeSheet = EasyExcel.writerSheet("员工合同").build(); int index = 0;
if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
contractInfo.setLimitStart(i);
contractInfo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmployeeContractExport(contractInfo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet("员工合同" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("员工合同" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
}
out.flush(); out.flush();
excelWriter.finish(); excelWriter.finish();
} catch (Exception e) { } catch (Exception e) {
...@@ -1175,11 +1192,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1175,11 +1192,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) { if (contractInfo != null && contractInfo.getExportFields() != null && !contractInfo.getExportFields().isEmpty()) {
String fileName = "员工合同批量导出【合并历史】" + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = "员工合同批量导出【合并历史】" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表 //获取要导出的列表
List<EmployeeContractExportVO> list = baseMapper.getTEmployeeContractExportHistory(contractInfo); List<EmployeeContractExportVO> list = new ArrayList<>();
ServletOutputStream out = null; ServletOutputStream out = null;
if (list == null || list.isEmpty()) { Integer count = baseMapper.selectCountHistoryContractExport(contractInfo);
list = new ArrayList<>();
}
try { try {
ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class); ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class);
out = response.getOutputStream(); out = response.getOutputStream();
...@@ -1194,8 +1209,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1194,8 +1209,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class) ExcelWriter excelWriter = EasyExcel.write(out, EmployeeContractExportVO.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap)) .registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap))
.includeColumnFieldNames(contractInfo.getExportFields()).build(); .includeColumnFieldNames(contractInfo.getExportFields()).build();
WriteSheet writeSheet = EasyExcel.writerSheet("员工合同【合并历史】").build(); int index = 0;
if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
contractInfo.setLimitStart(i);
contractInfo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTEmployeeContractExportHistory(contractInfo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet("员工合同【合并历史】" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("员工合同【合并历史】" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
}
out.flush(); out.flush();
excelWriter.finish(); excelWriter.finish();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -445,6 +445,20 @@ ...@@ -445,6 +445,20 @@
order by a.APPLY_NO desc order by a.APPLY_NO desc
</select> </select>
<!--导出合同数量查询-->
<select id="selectCountContractExport" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/>
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
${tEmployeeContractInfo.authSql}
</if>
</where>
</select>
<!--导出--> <!--导出-->
<select id="getTEmployeeContractExport" resultMap="tEmployeeContrctInfoExportMap"> <select id="getTEmployeeContractExport" resultMap="tEmployeeContrctInfoExportMap">
SELECT SELECT
...@@ -495,6 +509,21 @@ ...@@ -495,6 +509,21 @@
</where> </where>
GROUP BY a.id GROUP BY a.id
order by a.APPLY_NO desc order by a.APPLY_NO desc
limit #{tEmployeeContractInfo.limitStart},#{tEmployeeContractInfo.limitEnd}
</select>
<!--导出历史合并合同数量查询-->
<select id="selectCountHistoryContractExport" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null and a.SITUATION != '作废' and a.SITUATION != '终止'
<include refid="tEmployeeContractInfo_where"/>
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
${tEmployeeContractInfo.authSql}
</if>
</where>
</select> </select>
<!--导出历史合并--> <!--导出历史合并-->
...@@ -551,6 +580,7 @@ ...@@ -551,6 +580,7 @@
</where> </where>
GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN
order by a.APPLY_NO desc order by a.APPLY_NO desc
limit #{tEmployeeContractInfo.limitStart},#{tEmployeeContractInfo.limitEnd}
</select> </select>
<!--tEmployeeContractInfo简单分页查询--> <!--tEmployeeContractInfo简单分页查询-->
......
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