Commit 1f512df4 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.7.12' into MVP1.7.12

parents 23e658ce 8da05fc2
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.vo; package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
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.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import lombok.Data; import lombok.Data;
...@@ -32,6 +33,7 @@ import java.math.BigDecimal; ...@@ -32,6 +33,7 @@ import java.math.BigDecimal;
* @date 2025-6-17 09:38:47 * @date 2025-6-17 09:38:47
*/ */
@Data @Data
@ColumnWidth(15)
public class TGzOfferInfoExportDetailVo implements Serializable { public class TGzOfferInfoExportDetailVo implements Serializable {
@ExcelProperty("流程ID") @ExcelProperty("流程ID")
......
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
package com.yifu.cloud.plus.v1.yifu.archives.vo; package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
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.util.LocalDateTimeUtils;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* 导出-瓜子offer信息接收表 * 导出-瓜子offer信息接收表
...@@ -32,6 +31,7 @@ import java.util.Date; ...@@ -32,6 +31,7 @@ import java.util.Date;
* @date 2025-6-17 09:38:47 * @date 2025-6-17 09:38:47
*/ */
@Data @Data
@ColumnWidth(25)
public class TGzOfferInfoExportMainVo implements Serializable { public class TGzOfferInfoExportMainVo implements Serializable {
@ExcelProperty("流程ID") @ExcelProperty("流程ID")
......
...@@ -146,13 +146,14 @@ public class TGzEmpInfoController { ...@@ -146,13 +146,14 @@ public class TGzEmpInfoController {
/** /**
* 瓜子档案表 批量导出 * @Description: 瓜子档案表 批量导出
* * @Author: hgw
* @Date: 2025/6/18 17:24
* @return: void
**/ **/
@Operation(description = "导出瓜子档案表 hasPermission('archives_tgzempinfo-export')") @Operation(description = "导出瓜子档案表 ")
@PostMapping("/export") @PostMapping("/exportGzEmpInfo")
@PreAuthorize("@pms.hasPermission('archives_tgzempinfo-export')") public void exportGzEmpInfo(HttpServletResponse response, @RequestBody TGzEmpInfoSearchVo searchVo) {
public void export(HttpServletResponse response, @RequestBody TGzEmpInfoSearchVo searchVo) {
tGzEmpInfoService.listExport(response, searchVo); tGzEmpInfoService.listExport(response, searchVo);
} }
} }
...@@ -21,10 +21,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,10 +21,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoExportMain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 瓜子档案表 * 瓜子档案表
* *
...@@ -40,4 +45,20 @@ public interface TGzEmpInfoMapper extends BaseMapper<TGzEmpInfo> { ...@@ -40,4 +45,20 @@ public interface TGzEmpInfoMapper extends BaseMapper<TGzEmpInfo> {
* @return * @return
*/ */
IPage<TGzEmpInfo> getTGzEmpInfoPage(Page<TGzEmpInfo> page, @Param("tGzEmpInfo") TGzEmpInfoSearchVo tGzEmpInfo); IPage<TGzEmpInfo> getTGzEmpInfoPage(Page<TGzEmpInfo> page, @Param("tGzEmpInfo") TGzEmpInfoSearchVo tGzEmpInfo);
/**
* @Description: 导出前先查条数
* @Author: hgw
* @Date: 2025/6/18 15:11
* @return: int
**/
int getTGzEmpInfoCount(@Param("tGzEmpInfo") TGzEmpInfoSearchVo tGzEmpInfo);
/**
* @Description: 导出主表数据
* @Author: hgw
* @Date: 2025/6/18 15:12
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo>
**/
List<TGzEmpInfoExportMain> getTGzEmpInfoList(@Param("tGzEmpInfo") TGzEmpInfoSearchVo tGzEmpInfo);
} }
...@@ -17,16 +17,28 @@ ...@@ -17,16 +17,28 @@
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.excel.EasyExcelFactory;
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.*; import com.yifu.cloud.plus.v1.yifu.archives.mapper.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzEmpInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TGzEmpInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil; import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoExportMain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportDetailVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzOfferInfoExportMainVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
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.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -34,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo; ...@@ -34,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.HashMap;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
...@@ -58,6 +71,7 @@ import javax.servlet.ServletOutputStream; ...@@ -58,6 +71,7 @@ import javax.servlet.ServletOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map;
/** /**
* 瓜子档案表 * 瓜子档案表
...@@ -68,6 +82,7 @@ import java.util.ArrayList; ...@@ -68,6 +82,7 @@ import java.util.ArrayList;
@Log4j2 @Log4j2
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@EnableConfigurationProperties(DaprUpmsProperties.class)
public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpInfo> implements TGzEmpInfoService { public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpInfo> implements TGzEmpInfoService {
private final TGzOfferInfoService gzOfferInfoService; private final TGzOfferInfoService gzOfferInfoService;
...@@ -84,6 +99,9 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI ...@@ -84,6 +99,9 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
private final TAttaInfoService attaInfoService; private final TAttaInfoService attaInfoService;
// 拿区域
private final DaprUpmsProperties daprUpmsProperties;
@Autowired @Autowired
private OSSUtil ossUtil; private OSSUtil ossUtil;
...@@ -217,44 +235,52 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI ...@@ -217,44 +235,52 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TGzEmpInfoSearchVo searchVo) { public void listExport(HttpServletResponse response, TGzEmpInfoSearchVo searchVo) {
String fileName = "瓜子档案表批量导出" + DateUtil.getThisTime() + ".xlsx"; String prfName = "瓜子员工档案信息";
String fileName = prfName + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TGzEmpInfo> list = new ArrayList<>(); List<TGzEmpInfoExportMain> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = baseMapper.getTGzEmpInfoCount(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
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));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list); Map<String,String> idLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE_ALL);
ExcelWriter excelWriter = EasyExcel.write(out, TGzEmpInfo.class).build(); 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();
}
}
if (redisLabelMap != null && idLabelMap != null) {
redisLabelMap.putAll(idLabelMap);
}
Map<String,String> nameAndDicTypeMap = new HashMap<>();
ExcelUtil.getDictMapAndExp(TGzEmpInfoExportMain.class, nameAndDicTypeMap, redisLabelMap);
ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzEmpInfoExportMain.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) { WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT){
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = baseMapper.getTGzEmpInfoList(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TGzEmpInfo> util = new ExcelUtil<>(TGzEmpInfo.class);
for (TGzEmpInfo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("瓜子档案表" + index).build(); writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
} }
} else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("瓜子档案表" + index).build(); WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
......
...@@ -578,23 +578,19 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -578,23 +578,19 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
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));
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE); Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Map<String,String> nameAndDicTypeMap = getConverterDicTypeAndArea(TGzOfferInfoExportMainVo.class, redisLabelMap); Map<String,String> nameAndDicTypeMap = new HashMap<>();
ExcelUtil.getDictMapAndExp(TGzOfferInfoExportMainVo.class, nameAndDicTypeMap, redisLabelMap);
ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzOfferInfoExportMainVo.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).build(); ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzOfferInfoExportMainVo.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT){ for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT){
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTGzOfferMainList(searchVo); list = baseMapper.getTGzOfferMainList(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<TGzOfferInfoExportMainVo> util = new ExcelUtil<>(TGzOfferInfoExportMainVo.class); writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
for (TGzOfferInfoExportMainVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
...@@ -646,17 +642,19 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -646,17 +642,19 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
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));
// 这是获取所有字典的值 // 这是获取所有字典的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE); Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
Map<String,String> nameAndDicTypeMap = getConverterDicTypeAndArea(TGzOfferInfoExportDetailVo.class, redisLabelMap); Map<String,String> nameAndDicTypeMap = new HashMap<>();
ExcelUtil.getDictMapAndExp(TGzOfferInfoExportDetailVo.class, nameAndDicTypeMap, redisLabelMap);
ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzOfferInfoExportDetailVo.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).build(); ExcelWriter excelWriter = EasyExcelFactory.write(out, TGzOfferInfoExportDetailVo.class).registerConverter(new DictConverter(nameAndDicTypeMap, redisLabelMap)).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT){ for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT){
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTGzOfferDetailList(searchVo); list = baseMapper.getTGzOfferDetailList(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet(prfName + index).build(); writeSheet = EasyExcelFactory.writerSheet(prfName + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
...@@ -687,44 +685,4 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz ...@@ -687,44 +685,4 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
} }
} }
private Map<String,String> getConverterDicTypeAndArea(Class<?> clazz, Map<String,String> redisLabelMap) {
// 得到所有定义字段
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;
String[] convertSource;
String[] itemArray;
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()) && attr.isArea()) {
nameDicMap.put(field.getName(), CacheConstants.AREA_VALUE_ALL);
} else if (Common.isNotNull(attr.readConverterExp())) {
convertSource = attr.readConverterExp().split(",");
if (Common.isNotNull(convertSource)) {
for (String item : convertSource) {
itemArray = item.split("=");
if (itemArray.length >1) {
redisLabelMap.put(field.getName()+CommonConstants.DOWN_LINE_STRING+itemArray[0],itemArray[1]);
}
}
nameDicMap.put(field.getName(), field.getName());
}
}
}
}
return nameDicMap;
}
} }
...@@ -404,4 +404,107 @@ ...@@ -404,4 +404,107 @@
</where> </where>
ORDER by a.create_time desc,a.id desc ORDER by a.create_time desc,a.id desc
</select> </select>
<!--count-->
<select id="getTGzEmpInfoCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_gz_emp_info a
<where>
a.del_flag = '0'
<include refid="tGzEmpInfo_where"/>
</where>
</select>
<!--导出-->
<select id="getTGzEmpInfoList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoExportMain">
SELECT
a.id,
a.biz_id,
a.offer_id,
a.emp_push_status,
a.contract_push_status,
a.contract_atta_push_status,
a.del_flag,
a.create_time,
a.create_by,
a.create_name,
a.update_by,
a.update_time,
a.name,
a.name_ac,
a.birthdate,
a.sex,
a.constel,
a.blood_type,
a.start_date,
a.country,
a.native_place,
a.ethnic_grp_cd,
a.mar_status,
a.political_sta,
a.insurance_sta,
a.driver_type,
a.driver_licen_exp,
a.national_id_type,
a.national_id,
a.persist_flag,
a.nid_start_date,
a.nid_expiry_date,
a.phone,
a.mail,
a.address_type,
a.state_id,
a.city_id,
a.county_id,
a.address,
a.sginature_method,
a.contract_num,
a.contract_type,
a.sginature_type,
a.probation,
a.sginature_dt,
a.contract_begin_dt,
a.contract_exp_end_dt,
a.contract_end_dt,
a.probation_dt,
a.prc_exp_dt,
a.nee_provider_id,
a.work_location,
a.contract_state,
a.hukou_type,
a.hukou_province,
a.hukou_city,
a.hukou_county,
a.hukou_detail,
a.account_type,
a.account_status,
a.account_country,
a.bank_cd,
a.cnaps_id,
a.bank_name,
a.account_province,
a.account_city,
a.account_ec_id,
a.account_name,
a.native_place_area_id,
a.state_area_id,
a.city_area_id,
a.county_area_id,
a.hukou_province_area_id,
a.hukou_city_area_id,
a.hukou_county_area_id,
a.account_province_area_id,
a.account_city_area_id
FROM t_gz_emp_info a
<where>
a.del_flag = '0'
<include refid="tGzEmpInfo_where"/>
</where>
ORDER by a.create_time desc,a.id desc
<if test="tGzEmpInfo.limitStart != null">
limit #{tGzEmpInfo.limitStart},#{tGzEmpInfo.limitEnd}
</if>
</select>
</mapper> </mapper>
...@@ -297,8 +297,7 @@ ...@@ -297,8 +297,7 @@
count(1) count(1)
FROM t_gz_offer_info a FROM t_gz_offer_info a
where a.del_flag = '0' where a.del_flag = '0'
<include refid="tGzOfferInfo_where"/> <include refid="tGzOfferInfo_where"/>
ORDER by a.create_time desc,a.id desc
</select> </select>
<!-- 导出ORRER字段 --> <!-- 导出ORRER字段 -->
......
...@@ -175,4 +175,26 @@ public class ExcelAttributeConstants { ...@@ -175,4 +175,26 @@ public class ExcelAttributeConstants {
public static final String GZ_SEX = "gz_sex"; public static final String GZ_SEX = "gz_sex";
// 瓜子的外签类型 // 瓜子的外签类型
public static final String GZ_OUT_SGIN_TYPE = "gz_out_sgin_type"; public static final String GZ_OUT_SGIN_TYPE = "gz_out_sgin_type";
// 瓜子的民族
public static final String GZ_ETHNIC_GRP_CD = "gz_ethnic_grp_cd";
// 瓜子的政治面貌
public static final String GZ_POLITICAL_STA = "gz_political_sta";
// 瓜子的婚姻状态
public static final String GZ_MAR_STATUS = "gz_mar_status";
// 瓜子的驾驶证类型
public static final String GZ_DRIVER_TYPE = "gz_driver_type";
// 瓜子的紧急联系人关系
public static final String GZ_EMERG_RELATION = "gz_emerg_relation";
// 瓜子的合同签署方式
public static final String GZ_SGINATURE_METHOD = "gz_sginature_method";
// 瓜子的合同类型
public static final String GZ_CONTRACT_TYPE = "gz_contract_type";
// 瓜子的合同签订类型
public static final String GZ_SGINATURE_TYPE = "gz_sginature_type";
// 瓜子的户口类型
public static final String GZ_HUKOU_TYPE = "gz_hukou_type";
// 瓜子的银行账户类型
public static final String GZ_ACCOUNT_TYPE = "gz_account_type";
// 瓜子的银行
public static final String GZ_BANK = "gz_bank";
} }
...@@ -1144,4 +1144,51 @@ public class ExcelUtil <T> implements Serializable { ...@@ -1144,4 +1144,51 @@ public class ExcelUtil <T> implements Serializable {
} }
return nameDicMap; return nameDicMap;
} }
/**
* @param clazz 类
* @param nameDicMap 需要翻译的属性
* @param redisLabelMap 字典MAP,这里传进来,额外加上固定需要翻译的值
* @Description: 组装需要翻译的map,并且组装固定的值的map
* @Author: hgw
* @Date: 2025/6/18 14:49
* @return: void
**/
public static void getDictMapAndExp(Class<?> clazz, Map<String,String> nameDictMap, Map<String,String> redisLabelMap) {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
List<Field> fieldList = new ArrayList<>();
// 将需要字典表头存起来备用,如果没传,则全部翻译
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fieldList.add(field);
}
}
ExcelAttribute attr;
Field field;
String[] convertSource;
String[] itemArray;
for (int j = 0; j < fieldList.size(); j++) {
field = fieldList.get(j);
attr = field.getAnnotation(ExcelAttribute.class);
if (Common.isNotNull(field) && Common.isNotNull(attr)){
if (Common.isNotNull(attr.dataType())) {
nameDictMap.put(field.getName(), attr.dataType());
} else if (Common.isNotNull(attr.isArea()) && attr.isArea()) {
nameDictMap.put(field.getName(), CacheConstants.AREA_VALUE_ALL);
} else if (Common.isNotNull(attr.readConverterExp())) {
convertSource = attr.readConverterExp().split(",");
if (Common.isNotNull(convertSource)) {
for (String item : convertSource) {
itemArray = item.split("=");
if (itemArray.length >1) {
redisLabelMap.put(field.getName()+CommonConstants.DOWN_LINE_STRING+itemArray[0],itemArray[1]);
}
}
nameDictMap.put(field.getName(), field.getName());
}
}
}
}
}
} }
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