Commit c8b4aa08 authored by hongguangwu's avatar hongguangwu

MVP1.7.0 优化导出

parent 62e21be7
......@@ -101,7 +101,7 @@ public class PreUploadEmpImportVo implements Serializable {
private String relationCity;
@ExcelAttribute(name = "联系地址-区/县", isNotEmpty = true, isArea = true, parentField = "relationCity")
private String relationTown;
@ExcelAttribute(name = "联系地址-详细地址", isNotEmpty = true, errorInfo = "联系地址-街道、详情不能为空", maxLength = 100)
@ExcelAttribute(name = "联系地址-详细地址", isNotEmpty = true, errorInfo = "联系地址-街道、详情不能为空", maxLength = 200)
private String address;
@ExcelAttribute(name = "手机号码(紧急联系人)", isPhone = true, isNotEmpty = true, errorInfo = "手机号码(紧急联系人)不能为空", maxLength = 20)
private String tel;
......
......@@ -93,13 +93,13 @@ public interface TCompleteMonitorMapper extends BaseMapper<TCompleteMonitor> {
int getTEmpMainAllCount(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
// 导出详情使用 hgw 2024-6-26 11:05:41
List<TMainExportAllVO> getTEmpMainAllList(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByContract(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByEducation(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByBad(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByDisability(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByWork(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByFamily(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByProfessional(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
List<TMainExportAllVO> getTEmpMainAllListByContract(@Param("empIdList") List<String> empIdList);
List<TMainExportAllVO> getTEmpMainAllListByEducation(@Param("empIdList") List<String> empIdList);
List<TMainExportAllVO> getTEmpMainAllListByBad(@Param("empIdList") List<String> empIdList);
List<TMainExportAllVO> getTEmpMainAllListByDisability(@Param("empIdList") List<String> empIdList);
List<TMainExportAllVO> getTEmpMainAllListByWork(@Param("empIdList") List<String> empIdList);
List<TMainExportAllVO> getTEmpMainAllListByFamily(@Param("empIdList") List<String> empIdList);
List<TMainExportAllVO> getTEmpMainAllListByProfessional(@Param("empIdList") List<String> empIdList);
// 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCountOneWork(@Param("tCompleteMonitor") TCompleteMonitor tCompleteMonitor);
......
......@@ -52,9 +52,9 @@ public interface TPreEmpMainMapper extends BaseMapper<TPreEmpMain> {
int getTPreEmpMainAllCount(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllList(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByFamily(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByProfessional(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
List<TPreMainExportAllVO> getTPreEmpMainAllListByWork(@Param("preMainIdList") List<String> preMainIdList);
List<TPreMainExportAllVO> getTPreEmpMainAllListByFamily(@Param("preMainIdList") List<String> preMainIdList);
List<TPreMainExportAllVO> getTPreEmpMainAllListByProfessional(@Param("preMainIdList") List<String> preMainIdList);
// 导出详情使用 hgw 2024-6-26 11:05:41
int getTEmpMainAllCountOneWork(@Param("tPreEmpMain") TPreEmpMain tPreEmpMain);
......
......@@ -276,9 +276,12 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
exportLimit.setType(CommonConstants.TWO_INT);
List<TArchivesExportLimit> limitList = tArchivesExportLimitMapper.getLimitList(exportLimit);
boolean myExport = false;
for (TArchivesExportLimit limit1 : limitList) {
if (limit1.getCreateBy().equals(user.getId())) {
myExport = true;
if (limitList != null) {
for (TArchivesExportLimit limit1 : limitList) {
if (limit1.getCreateBy().equals(user.getId())) {
myExport = true;
break;
}
}
}
String name = "档案完整度监控详情";
......@@ -419,61 +422,66 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
Map<String, TMainExportAllVO> mapProfessional;
TMainExportAllVO temp;
Set<String> titleContent = getExportFieldNameDetailByClass(TMainExportAllVO.class);
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
List<String> empIdList;
for (int i = 0; i <= count; i += limitNum) {
empIdList = new ArrayList<>();
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
searchVo.setLimitEnd(limitNum);
list = baseMapper.getTEmpMainAllList(searchVo);
listContract = baseMapper.getTEmpMainAllListByContract(searchVo);
listEducation = baseMapper.getTEmpMainAllListByEducation(searchVo);
listBad = baseMapper.getTEmpMainAllListByBad(searchVo);
listDisability = baseMapper.getTEmpMainAllListByDisability(searchVo);
listWork = baseMapper.getTEmpMainAllListByWork(searchVo);
listFamily = baseMapper.getTEmpMainAllListByFamily(searchVo);
listProfessional = baseMapper.getTEmpMainAllListByProfessional(searchVo);
mapContract = new HashMap<>();
mapEducation = new HashMap<>();
mapBad = new HashMap<>();
mapDisability = new HashMap<>();
mapWork = new HashMap<>();
mapFamily = new HashMap<>();
mapProfessional = new HashMap<>();
if (listContract != null && !listContract.isEmpty()) {
for (TMainExportAllVO vo : listContract) {
mapContract.putIfAbsent(vo.getMainId(), vo);
if (list != null && !list.isEmpty()) {
for (TMainExportAllVO vo : list) {
empIdList.add(vo.getMainId());
}
}
if (listEducation != null && !listEducation.isEmpty()) {
for (TMainExportAllVO vo : listEducation) {
mapEducation.putIfAbsent(vo.getMainId(), vo);
listContract = baseMapper.getTEmpMainAllListByContract(empIdList);
listEducation = baseMapper.getTEmpMainAllListByEducation(empIdList);
listBad = baseMapper.getTEmpMainAllListByBad(empIdList);
listDisability = baseMapper.getTEmpMainAllListByDisability(empIdList);
listWork = baseMapper.getTEmpMainAllListByWork(empIdList);
listFamily = baseMapper.getTEmpMainAllListByFamily(empIdList);
listProfessional = baseMapper.getTEmpMainAllListByProfessional(empIdList);
mapContract = new HashMap<>();
mapEducation = new HashMap<>();
mapBad = new HashMap<>();
mapDisability = new HashMap<>();
mapWork = new HashMap<>();
mapFamily = new HashMap<>();
mapProfessional = new HashMap<>();
if (listContract != null && !listContract.isEmpty()) {
for (TMainExportAllVO vo : listContract) {
mapContract.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (listBad != null && !listBad.isEmpty()) {
for (TMainExportAllVO vo : listBad) {
mapEducation.putIfAbsent(vo.getMainId(), vo);
if (listEducation != null && !listEducation.isEmpty()) {
for (TMainExportAllVO vo : listEducation) {
mapEducation.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (listDisability != null && !listDisability.isEmpty()) {
for (TMainExportAllVO vo : listDisability) {
mapDisability.putIfAbsent(vo.getMainId(), vo);
if (listBad != null && !listBad.isEmpty()) {
for (TMainExportAllVO vo : listBad) {
mapEducation.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (listWork != null && !listWork.isEmpty()) {
for (TMainExportAllVO vo : listWork) {
mapWork.putIfAbsent(vo.getMainId(), vo);
if (listDisability != null && !listDisability.isEmpty()) {
for (TMainExportAllVO vo : listDisability) {
mapDisability.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (listFamily != null && !listFamily.isEmpty()) {
for (TMainExportAllVO vo : listFamily) {
mapFamily.putIfAbsent(vo.getMainId(), vo);
if (listWork != null && !listWork.isEmpty()) {
for (TMainExportAllVO vo : listWork) {
mapWork.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (listProfessional != null && !listProfessional.isEmpty()) {
for (TMainExportAllVO vo : listProfessional) {
mapProfessional.putIfAbsent(vo.getMainId(), vo);
if (listFamily != null && !listFamily.isEmpty()) {
for (TMainExportAllVO vo : listFamily) {
mapFamily.putIfAbsent(vo.getMainId(), vo);
}
}
if (listProfessional != null && !listProfessional.isEmpty()) {
for (TMainExportAllVO vo : listProfessional) {
mapProfessional.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (Common.isNotNull(list)) {
for (TMainExportAllVO vo : list) {
temp = mapContract.get(vo.getMainId());
if (temp != null) {
......
......@@ -2399,9 +2399,12 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
exportLimit.setType(CommonConstants.ONE_INT);
List<TArchivesExportLimit> limitList = tArchivesExportLimitMapper.getLimitList(exportLimit);
boolean myExport = false;
for (TArchivesExportLimit limit1 : limitList) {
if (limit1.getCreateBy().equals(user.getId())) {
myExport = true;
if (limitList != null) {
for (TArchivesExportLimit limit1 : limitList) {
if (limit1.getCreateBy().equals(user.getId())) {
myExport = true;
break;
}
}
}
String name = "预入职导出全量";
......@@ -2539,33 +2542,39 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
Map<String, TPreMainExportAllVO> mapProfessional;
TPreMainExportAllVO temp;
Set<String> titleContent = getExportFieldNameDetailByClass(TPreMainExportAllVO.class);
List<String> preMainIdList;
for (int i = 0; i <= count; i += limitNum) {
preMainIdList = new ArrayList<>();
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(limitNum);
list = baseMapper.getTPreEmpMainAllList(searchVo);
listWork = baseMapper.getTPreEmpMainAllListByWork(searchVo);
listFamily = baseMapper.getTPreEmpMainAllListByFamily(searchVo);
listProfessional = baseMapper.getTPreEmpMainAllListByProfessional(searchVo);
mapWork = new HashMap<>();
mapFamily = new HashMap<>();
mapProfessional = new HashMap<>();
if (listWork != null && !listWork.isEmpty()) {
for (TPreMainExportAllVO vo : listWork) {
mapWork.putIfAbsent(vo.getMainId(), vo);
if (list != null && !list.isEmpty()) {
for (TPreMainExportAllVO vo : list) {
preMainIdList.add(vo.getMainId());
}
}
if (listFamily != null && !listFamily.isEmpty()) {
for (TPreMainExportAllVO vo : listFamily) {
mapFamily.putIfAbsent(vo.getMainId(), vo);
listWork = baseMapper.getTPreEmpMainAllListByWork(preMainIdList);
listFamily = baseMapper.getTPreEmpMainAllListByFamily(preMainIdList);
listProfessional = baseMapper.getTPreEmpMainAllListByProfessional(preMainIdList);
mapWork = new HashMap<>();
mapFamily = new HashMap<>();
mapProfessional = new HashMap<>();
if (listWork != null && !listWork.isEmpty()) {
for (TPreMainExportAllVO vo : listWork) {
mapWork.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (listProfessional != null && !listProfessional.isEmpty()) {
for (TPreMainExportAllVO vo : listProfessional) {
mapProfessional.putIfAbsent(vo.getMainId(), vo);
if (listFamily != null && !listFamily.isEmpty()) {
for (TPreMainExportAllVO vo : listFamily) {
mapFamily.putIfAbsent(vo.getMainId(), vo);
}
}
}
if (Common.isNotNull(list)) {
if (listProfessional != null && !listProfessional.isEmpty()) {
for (TPreMainExportAllVO vo : listProfessional) {
mapProfessional.putIfAbsent(vo.getMainId(), vo);
}
}
for (TPreMainExportAllVO vo : list) {
temp = mapWork.get(vo.getMainId());
if (temp != null) {
......
......@@ -317,64 +317,34 @@
<select id="getTPreEmpMainAllListByWork" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
ee.PRE_MAIN_ID mainId,ee.WORK_UNIT field44,ee.WORK_JOB field45,ee.START_DATE field46,ee.END_DATE field47
from t_pre_emp_main a join t_pre_emp_work_recording ee on a.id = ee.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
from t_pre_emp_work_recording ee
where ee.PRE_MAIN_ID in
<foreach collection="preMainIdList" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
ORDER BY ee.create_time desc
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<select id="getTPreEmpMainAllListByFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
a.id mainId,ee.FAMILY_NAME field48,ee.RELATIONSHIP_SELF field49,ee.CONTRACT_TEL field50
FROM t_pre_emp_main a join t_pre_emp_family ee on a.id = ee.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
ee.PRE_MAIN_ID mainId,ee.FAMILY_NAME field48,ee.RELATIONSHIP_SELF field49,ee.CONTRACT_TEL field50
FROM t_pre_emp_family ee
where ee.PRE_MAIN_ID in
<foreach collection="preMainIdList" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
ORDER BY ee.create_time desc
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</select>
<select id="getTPreEmpMainAllListByProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT
a.id mainId,ee.DECLARE_YEAR field52,ee.QUALIFICATION_TYPE field53
FROM t_pre_emp_main a join t_pre_emp_professional_qualification ee on a.id = ee.PRE_MAIN_ID
<where>
a.STATUS != '5'
<include refid="tPreEmpMain_where"/>
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.authSql != null and tPreEmpMain.authSql.trim() != ''">
${tPreEmpMain.authSql}
</if>
</if>
</where>
ee.PRE_MAIN_ID mainId,ee.DECLARE_YEAR field52,ee.QUALIFICATION_TYPE field53
FROM t_pre_emp_professional_qualification ee
where ee.PRE_MAIN_ID in
<foreach collection="preMainIdList" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
ORDER BY ee.create_time desc
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.limitStart != null">
limit #{tPreEmpMain.limitStart},#{tPreEmpMain.limitEnd}
</if>
</if>
</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