Commit b3353825 authored by hongguangwu's avatar hongguangwu

MVP1.7.0 优化

parent e6dae7ab
...@@ -8,6 +8,7 @@ import com.alibaba.excel.write.metadata.WriteSheet; ...@@ -8,6 +8,7 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCompleteMonitorMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCompleteMonitorMapper;
...@@ -15,14 +16,19 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; ...@@ -15,14 +16,19 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ExcelStyle; import com.yifu.cloud.plus.v1.yifu.archives.utils.ExcelStyle;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -43,9 +49,11 @@ import java.util.*; ...@@ -43,9 +49,11 @@ import java.util.*;
@Log4j2 @Log4j2
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@EnableConfigurationProperties({DaprUpmsProperties.class})
public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMapper, TCompleteMonitor> implements TCompleteMonitorService { public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMapper, TCompleteMonitor> implements TCompleteMonitorService {
private final TEmployeeProjectMapper projectMapper; private final TEmployeeProjectMapper projectMapper;
private final DaprUpmsProperties daprUpmsProperties;
// 档案相关服务: // 档案相关服务:
// 员工不良记录表 // 员工不良记录表
...@@ -296,9 +304,10 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -296,9 +304,10 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
ExcelWriter excelWriter = null; ExcelWriter excelWriter = null;
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) { if (count > 200000) {
//if (count > CommonConstants.EXCEL_EXPORT_LIMIT)
List<List<String>> strList = new ArrayList<>(); List<List<String>> strList = new ArrayList<>();
strList.add(this.getNewArrayList(new String[]{"数据超过6万条,请联系管理员后端导出!"})); strList.add(this.getNewArrayList(new String[]{"数据超过20万条,请联系管理员后端导出!"}));
List<List<String>> headList = Lists.newArrayList(); List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提示"})); headList.add(this.getNewArrayList(new String[]{"提示"}));
EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList); EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList);
...@@ -399,11 +408,26 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -399,11 +408,26 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
oneTitle = "不良记录"; oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"})); headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype()).head(headList).build(); Set<String> titleContent = getExportFieldNameDetailByClass(TMainExportAllVO.class);
//ExcelUtil<TMainExportAllVO> util = new ExcelUtil<>(TMainExportAllVO.class)
// 获取所有字典type
Map<String,String> nameAndDicTypeMap = getConverterDicTypeAndArea(TMainExportAllVO.class);
// 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Map<String,String> idLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE_ALL);
if (Common.isEmpty(idLabelMap) || idLabelMap.isEmpty()) {
R<AreaMap> areaListR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId(), "/area/inner/getAreaMapAll", "", AreaMap.class, SecurityConstants.FROM_IN);
if (Common.isNotNull(areaListR)) {
idLabelMap = areaListR.getData().getIdLabelMap();
}
}
redisLabelMap.putAll(idLabelMap);
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype())
.registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(titleContent).head(headList).build();
int index = 1; int index = 1;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
ExcelUtil<TMainExportAllVO> util = new ExcelUtil<>(TMainExportAllVO.class);
int limitNum = 10000; int limitNum = 10000;
ExcelWriterSheetBuilder writeSheet; ExcelWriterSheetBuilder writeSheet;
List<TMainExportAllVO> listWork; List<TMainExportAllVO> listWork;
...@@ -421,9 +445,10 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -421,9 +445,10 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
List<TMainExportAllVO> listProfessional; List<TMainExportAllVO> listProfessional;
Map<String, TMainExportAllVO> mapProfessional; Map<String, TMainExportAllVO> mapProfessional;
TMainExportAllVO temp; TMainExportAllVO temp;
Set<String> titleContent = getExportFieldNameDetailByClass(TMainExportAllVO.class);
List<String> empIdList; List<String> empIdList;
for (int i = 0; i <= count; i += limitNum) { for (int i = 0; i <= count; i += limitNum) {
System.out.println("进度:"+i+"/"+count);
empIdList = new ArrayList<>(); empIdList = new ArrayList<>();
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
...@@ -533,9 +558,8 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -533,9 +558,8 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
vo.setField52(temp.getField52()); vo.setField52(temp.getField52());
vo.setField53(temp.getField53()); vo.setField53(temp.getField53());
} }
util.convertEntity(vo, null, null, null);
} }
writeSheet = EasyExcelFactory.writerSheet(name + index).includeColumnFieldNames(titleContent); writeSheet = EasyExcelFactory.writerSheet(name + index);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
index++; index++;
} }
...@@ -625,6 +649,33 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap ...@@ -625,6 +649,33 @@ public class TCompleteMonitorServiceImpl extends ServiceImpl<TCompleteMonitorMap
} }
} }
private Map<String,String> getConverterDicTypeAndArea(Class<?> clazz) {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
Map<String,String> nameDicMap = new HashMap<>();
List<Field> fields = new ArrayList<>();
// 将需要字典表头存起来备用,如果没传,则全部翻译
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
}
}
ExcelAttribute attr;
Field field;
for (int j = 0; j < fields.size(); j++) {
field = fields.get(j);
attr = field.getAnnotation(ExcelAttribute.class);
if (Common.isNotNull(field) && Common.isNotNull(attr)){
if (Common.isNotNull(attr.dataType())) {
nameDicMap.put(field.getName(), attr.dataType());
} else if (Common.isNotNull(attr.isArea())) {
nameDicMap.put(field.getName(), CacheConstants.AREA_VALUE_ALL);
}
}
}
return nameDicMap;
}
/** /**
* @Description: 详情 * @Description: 详情
* @Author: huyc * @Author: huyc
......
...@@ -34,6 +34,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -34,6 +34,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo; import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard; import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo; import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper;
...@@ -52,6 +53,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.ExcelSheetVo; ...@@ -52,6 +53,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.ExcelSheetVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...@@ -87,7 +89,7 @@ import java.util.*; ...@@ -87,7 +89,7 @@ import java.util.*;
@Log4j2 @Log4j2
@AllArgsConstructor @AllArgsConstructor
@Service @Service
@EnableConfigurationProperties({DaprSalaryProperties.class, DaprCheckProperties.class}) @EnableConfigurationProperties({DaprSalaryProperties.class, DaprCheckProperties.class, DaprUpmsProperties.class})
public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreEmpMain> implements TPreEmpMainService { public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreEmpMain> implements TPreEmpMainService {
// 预入职-员工不良记录表 // 预入职-员工不良记录表
private final TPreEmpBadRecordService tPreEmpBadRecordService; private final TPreEmpBadRecordService tPreEmpBadRecordService;
...@@ -145,6 +147,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -145,6 +147,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
private final DaprSalaryProperties salaryProperties; private final DaprSalaryProperties salaryProperties;
// 导入批量校验身份证、卡号、手机号 // 导入批量校验身份证、卡号、手机号
private final DaprCheckProperties checkProperties; private final DaprCheckProperties checkProperties;
private final DaprUpmsProperties daprUpmsProperties;
private final TArchivesExportLimitMapper tArchivesExportLimitMapper; private final TArchivesExportLimitMapper tArchivesExportLimitMapper;
...@@ -2409,9 +2412,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2409,9 +2412,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
ExcelWriter excelWriter = null; ExcelWriter excelWriter = null;
if (count > CommonConstants.EXCEL_EXPORT_LIMIT) { if (count > 200000) {
//if (count > CommonConstants.EXCEL_EXPORT_LIMIT)
List<List<String>> strList = new ArrayList<>(); List<List<String>> strList = new ArrayList<>();
strList.add(this.getNewArrayList(new String[]{"数据超过6万条,请联系管理员后端导出!!"})); strList.add(this.getNewArrayList(new String[]{"数据超过20万条,请联系管理员后端导出!!"}));
List<List<String>> headList = Lists.newArrayList(); List<List<String>> headList = Lists.newArrayList();
headList.add(this.getNewArrayList(new String[]{"提示"})); headList.add(this.getNewArrayList(new String[]{"提示"}));
EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList); EasyExcelFactory.write(out).head(headList).sheet("数据超限").doWrite(strList);
...@@ -2517,10 +2521,26 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2517,10 +2521,26 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
oneTitle = "不良记录"; oneTitle = "不良记录";
headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"})); headList.add(this.getNewArrayList(new String[]{oneTitle, "不良记录描述"}));
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype()).head(headList).build(); Set<String> titleContent = getExportFieldNameDetailByClass(TMainExportAllVO.class);
// 获取所有字典type
Map<String,String> nameAndDicTypeMap = getConverterDicTypeAndArea(TMainExportAllVO.class);
// 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Map<String,String> idLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE_ALL);
if (Common.isEmpty(idLabelMap) || idLabelMap.isEmpty()) {
R<AreaMap> areaListR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/area/inner/getAreaMapAll", "", AreaMap.class, SecurityConstants.FROM_IN);
if (Common.isNotNull(areaListR)) {
idLabelMap = areaListR.getData().getIdLabelMap();
}
}
redisLabelMap.putAll(idLabelMap);
excelWriter = EasyExcelFactory.write(out).registerWriteHandler(ExcelStyle.getNormalStype())
.registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap))
.includeColumnFieldNames(titleContent).head(headList).build();
int index = 1; int index = 1;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
ExcelUtil<TPreMainExportAllVO> util = new ExcelUtil<>(TPreMainExportAllVO.class);
//int limitNum = CommonConstants.EXCEL_EXPORT_LIMIT //int limitNum = CommonConstants.EXCEL_EXPORT_LIMIT
int limitNum = 10000; int limitNum = 10000;
ExcelWriterSheetBuilder writeSheet; ExcelWriterSheetBuilder writeSheet;
...@@ -2531,7 +2551,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2531,7 +2551,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<TPreMainExportAllVO> listProfessional; List<TPreMainExportAllVO> listProfessional;
Map<String, TPreMainExportAllVO> mapProfessional; Map<String, TPreMainExportAllVO> mapProfessional;
TPreMainExportAllVO temp; TPreMainExportAllVO temp;
Set<String> titleContent = getExportFieldNameDetailByClass(TPreMainExportAllVO.class);
List<String> preMainIdList; List<String> preMainIdList;
for (int i = 0; i <= count; i += limitNum) { for (int i = 0; i <= count; i += limitNum) {
preMainIdList = new ArrayList<>(); preMainIdList = new ArrayList<>();
...@@ -2584,7 +2603,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2584,7 +2603,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
vo.setField52(temp.getField52()); vo.setField52(temp.getField52());
vo.setField53(temp.getField53()); vo.setField53(temp.getField53());
} }
util.convertEntity(vo, null, null, null);
} }
writeSheet = EasyExcelFactory.writerSheet(name + index).includeColumnFieldNames(titleContent); writeSheet = EasyExcelFactory.writerSheet(name + index).includeColumnFieldNames(titleContent);
excelWriter.write(list, writeSheet.build()); excelWriter.write(list, writeSheet.build());
...@@ -2691,6 +2709,33 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2691,6 +2709,33 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return exportfieldsName; return exportfieldsName;
} }
private Map<String,String> getConverterDicTypeAndArea(Class<?> clazz) {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
Map<String,String> nameDicMap = new HashMap<>();
List<Field> fields = new ArrayList<>();
// 将需要字典表头存起来备用,如果没传,则全部翻译
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
}
}
ExcelAttribute attr;
Field field;
for (int j = 0; j < fields.size(); j++) {
field = fields.get(j);
attr = field.getAnnotation(ExcelAttribute.class);
if (Common.isNotNull(field) && Common.isNotNull(attr)){
if (Common.isNotNull(attr.dataType())) {
nameDicMap.put(field.getName(), attr.dataType());
} else if (Common.isNotNull(attr.isArea())) {
nameDicMap.put(field.getName(), CacheConstants.AREA_VALUE_ALL);
}
}
}
return nameDicMap;
}
/** /**
* @param file 文件流 * @param file 文件流
* @Description: 导入预入职 * @Description: 导入预入职
...@@ -3067,7 +3112,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3067,7 +3112,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
List<String> idCardList = new ArrayList<>(); List<String> idCardList = new ArrayList<>();
for (PreUploadEmpImportVo info : excelList) { for (PreUploadEmpImportVo info : excelList) {
errorCheck = new StringBuilder(); errorCheck = new StringBuilder();
if (info.getIsMain()) { if (Common.isNotNull(info.getIsMain()) && Boolean.TRUE.equals(info.getIsMain())) {
if (Common.isNotNull(info.getEmpName())) { if (Common.isNotNull(info.getEmpName())) {
if (idCardFlag == 0) { if (idCardFlag == 0) {
if (Common.isNotNull(info.getEmpIdcard())) { if (Common.isNotNull(info.getEmpIdcard())) {
...@@ -3447,7 +3492,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3447,7 +3492,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpDisabilityInfo.setDisabilityName(info.getDisabilityName()); tPreEmpDisabilityInfo.setDisabilityName(info.getDisabilityName());
tPreEmpDisabilityInfo.setDisabilityLevel(info.getDisabilityLevelValue()); tPreEmpDisabilityInfo.setDisabilityLevel(info.getDisabilityLevelValue());
tPreEmpDisabilityInfo.setOtherFlag(info.getOtherFlagValue()); tPreEmpDisabilityInfo.setOtherFlag(info.getOtherFlagValue());
tPreEmpDisabilityInfo.setRemark(info.getRemark()); // tPreEmpDisabilityInfo.setRemark(info.getRemark())
preEmpDisabilityInfoList.add(tPreEmpDisabilityInfo); preEmpDisabilityInfoList.add(tPreEmpDisabilityInfo);
// 最高教育经历 // 最高教育经历
......
...@@ -451,9 +451,7 @@ ...@@ -451,9 +451,7 @@
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer">
SELECT SELECT
count(1) from ( count(DISTINCT ew.id)
SELECT
1
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id left join t_employee_info e on p.EMP_ID=e.id
...@@ -465,8 +463,6 @@ ...@@ -465,8 +463,6 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ew.id
) a
</select> </select>
<!--导出统计list1主要工作经历--> <!--导出统计list1主要工作经历-->
...@@ -495,9 +491,7 @@ ...@@ -495,9 +491,7 @@
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer">
SELECT SELECT
count(1) from ( count(DISTINCT ef.id)
SELECT
1
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id left join t_employee_info e on p.EMP_ID=e.id
...@@ -508,18 +502,16 @@ ...@@ -508,18 +502,16 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ef.id ) a
</select> </select>
<!--导出统计list2主要家庭成员信息--> <!--导出统计list2主要家庭成员信息-->
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO"> <select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT SELECT
e.emp_idcard field6 e.emp_idcard field6
,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50 ,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_family ef on e.id=ef.EMP_ID left join t_emp_family ef on e.id=ef.EMP_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
<where> <where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS ( p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
...@@ -537,9 +529,7 @@ ...@@ -537,9 +529,7 @@
<!-- 数量 --> <!-- 数量 -->
<select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer"> <select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer">
SELECT SELECT
count(1) from ( count(DISTINCT ep.id)
SELECT
1
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id left join t_employee_info e on p.EMP_ID=e.id
...@@ -550,18 +540,16 @@ ...@@ -550,18 +540,16 @@
) )
<include refid="tCompleteMonitor_where"/> <include refid="tCompleteMonitor_where"/>
</where> </where>
group by ep.id ) a
</select> </select>
<!--导出统计list3职业资格信息--> <!--导出统计list3职业资格信息-->
<select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO"> <select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT SELECT
e.emp_idcard field6 e.emp_idcard field6
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53 ,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,ep.QUALIFICATION_TYPE field53
FROM t_complete_monitor a FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_professional_qualification ep on e.id=ep.EMP_ID left join t_emp_professional_qualification ep on e.id=ep.EMP_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where> <where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ep.id is not null and ep.DELETE_FLAG = '0' and EXISTS ( p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ep.id is not null and ep.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id select 1 from (select a.emp_id from t_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
......
...@@ -402,11 +402,10 @@ ...@@ -402,11 +402,10 @@
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO"> <select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT SELECT
e.emp_idcard field6 e.emp_idcard field6
,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50 ,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
FROM t_pre_emp_main a FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
<where> <where>
a.STATUS != '5' and ef.id is not null and EXISTS ( a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.EMP_IDCARD from t_pre_emp_family a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ef.EMP_IDCARD select 1 from (select a.EMP_IDCARD from t_pre_emp_family a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ef.EMP_IDCARD
...@@ -439,11 +438,10 @@ ...@@ -439,11 +438,10 @@
<select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO"> <select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TPreMainExportAllVO">
SELECT SELECT
e.emp_idcard field6 e.emp_idcard field6
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53 ,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,ep.QUALIFICATION_TYPE field53
FROM t_pre_emp_main a FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where> <where>
a.STATUS != '5' and ep.id is not null and EXISTS ( a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.EMP_IDCARD from t_pre_emp_professional_qualification a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ep.EMP_IDCARD select 1 from (select a.EMP_IDCARD from t_pre_emp_professional_qualification a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ep.EMP_IDCARD
......
...@@ -127,6 +127,10 @@ public interface CacheConstants { ...@@ -127,6 +127,10 @@ public interface CacheConstants {
* 区域数据--值 * 区域数据--值
*/ */
String AREA_VALUE_GROUP = "area_value"; String AREA_VALUE_GROUP = "area_value";
/**
* 区域数据--总-hgw-导出使用
*/
String AREA_VALUE_ALL = "area_all";
/** /**
* 用户登录的项目vo缓存 * 用户登录的项目vo缓存
*/ */
......
...@@ -154,6 +154,38 @@ public class AreaController { ...@@ -154,6 +154,38 @@ public class AreaController {
redisUtil.set(CacheConstants.AREA_VALUE_GROUP,labelIdMap); redisUtil.set(CacheConstants.AREA_VALUE_GROUP,labelIdMap);
} }
} }
/**
* @param
* @Description: 获取所有区域list
* @Author: hgw
* @Date: 2024/10/28 15:55
* @return: com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap
**/
@Inner
@PostMapping("/inner/getAreaMapAll")
public AreaMap getAreaMapAll() {
Map<String, String> idLabelMap = (Map<String, String>) redisUtil.get(CacheConstants.AREA_VALUE_ALL);
if (Common.isEmpty(idLabelMap)){
idLabelMap = initAreaAllRedis();
}
AreaMap map = new AreaMap();
map.setIdLabelMap(idLabelMap);
return map;
}
private Map<String, String> initAreaAllRedis() {
List<SysArea> allAreas = sysAreaService.getAllArea();
Map<String, String> idLabelMap = new HashMap<>();
if (Common.isNotNull(allAreas)) {
for (SysArea area : allAreas) {
idLabelMap.put(CacheConstants.AREA_VALUE_ALL +CommonConstants.DOWN_LINE_STRING+ area.getId(), area.getAreaName());
}
redisUtil.set(CacheConstants.AREA_VALUE_ALL, idLabelMap);
}
return idLabelMap;
}
/** /**
* @Author fxj * @Author fxj
* @Description 地区map * @Description 地区map
......
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