Commit 0847b9f6 authored by hongguangwu's avatar hongguangwu

社保公积金查询-导出

parent d5baee3f
...@@ -340,7 +340,7 @@ public class TDispatchInfo extends BaseEntity { ...@@ -340,7 +340,7 @@ public class TDispatchInfo extends BaseEntity {
* 业务细分 personnel_type_sub * 业务细分 personnel_type_sub
*/ */
@ExcelAttribute(name = "业务细分", maxLength = 32) @ExcelAttribute(name = "业务细分", maxLength = 32)
@Schema(description = "业务细分", name = "contractName") @Schema(description = "业务细分", name = "contractSubName")
private String contractSubName; private String contractSubName;
/** /**
......
...@@ -225,28 +225,28 @@ public class TSocialFundInfo extends BaseEntity { ...@@ -225,28 +225,28 @@ public class TSocialFundInfo extends BaseEntity {
@ExcelProperty("公积金户" ) @ExcelProperty("公积金户" )
private String providentHouseholdName; private String providentHouseholdName;
/** /**
* 缴纳地-省 * 公积金缴纳地-省
*/ */
@Length(max = 32, message = "缴纳地-省 不能超过32个字符" ) @Length(max = 32, message = "公积金缴纳地-省 不能超过32个字符" )
@ExcelAttribute(name = "缴纳地-省", maxLength = 32) @ExcelAttribute(name = "公积金缴纳地-省", maxLength = 32)
@Schema(description = "缴纳地-省" ) @Schema(description = "公积金缴纳地-省" )
@ExcelProperty("缴纳地-省" ) @ExcelProperty("公积金缴纳地-省" )
private String fundProvince; private String fundProvince;
/** /**
* 缴纳地-市 * 公积金缴纳地-市
*/ */
@Length(max = 32, message = "缴纳地-市 不能超过32个字符" ) @Length(max = 32, message = "公积金缴纳地-市 不能超过32个字符" )
@ExcelAttribute(name = "缴纳地-市", maxLength = 32) @ExcelAttribute(name = "公积金缴纳地-市", maxLength = 32)
@Schema(description = "缴纳地-市" ) @Schema(description = "公积金缴纳地-市" )
@ExcelProperty("缴纳地-市" ) @ExcelProperty("公积金缴纳地-市" )
private String fundCity; private String fundCity;
/** /**
* 缴纳地-县 * 公积金缴纳地-县
*/ */
@Length(max = 32, message = "缴纳地-县 不能超过32个字符" ) @Length(max = 32, message = "公积金缴纳地-县 不能超过32个字符" )
@ExcelAttribute(name = "缴纳地-县", maxLength = 32) @ExcelAttribute(name = "公积金缴纳地-县", maxLength = 32)
@Schema(description = "缴纳地-县" ) @Schema(description = "公积金缴纳地-县" )
@ExcelProperty("缴纳地-县" ) @ExcelProperty("公积金缴纳地-县" )
private String fundTown; private String fundTown;
/** /**
* 社保派增状态:0待审核、1待办理、2办理成功、3部分办理失败、4办理失败 * 社保派增状态:0待审核、1待办理、2办理成功、3部分办理失败、4办理失败
......
...@@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 社保公积金查询表 * 社保公积金查询表
...@@ -31,28 +32,29 @@ import java.time.LocalDateTime; ...@@ -31,28 +32,29 @@ import java.time.LocalDateTime;
@Data @Data
public class TSocialFundInfoSearchVo extends TSocialFundInfo { public class TSocialFundInfoSearchVo extends TSocialFundInfo {
/** /**
* 多选导出或删除等操作 * 多选导出或删除等操作
*/ */
@Schema(description = "选中ID,多个逗号分割") @Schema(description = "选中ID,多个逗号分割")
private String ids; private String ids;
/** private List<String> idList;
* 创建时间区间 [开始时间,结束时间] /**
*/ * 创建时间区间 [开始时间,结束时间]
@Schema(description = "创建时间区间") */
private LocalDateTime[] createTimes; @Schema(description = "创建时间区间")
/** private LocalDateTime[] createTimes;
* @Author fxj /**
* 查询数据起 * @Author fxj
**/ * 查询数据起
@Schema(description = "查询limit 开始") **/
private int limitStart; @Schema(description = "查询limit 开始")
/** private int limitStart;
* @Author fxj /**
* 查询数据止 * @Author fxj
**/ * 查询数据止
@Schema(description = "查询limit 数据条数") **/
private int limitEnd; @Schema(description = "查询limit 数据条数")
private int limitEnd;
} }
...@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,6 +21,8 @@ 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.social.entity.TSocialFundInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -57,4 +59,7 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> { ...@@ -57,4 +59,7 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> {
**/ **/
List<TSocialFundInfo> getFundList(@Param("empIdCard") String empIdCard, @Param("settleDomainIds") List<String> settleDomainIds); List<TSocialFundInfo> getFundList(@Param("empIdCard") String empIdCard, @Param("settleDomainIds") List<String> settleDomainIds);
List<TSocialFundInfoExportVo> exportList(@Param("tSocialFundInfo") TSocialFundInfoSearchVo tSocialFundInfo);
} }
...@@ -53,7 +53,13 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> { ...@@ -53,7 +53,13 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
**/ **/
R<List<ErrorMessage>> importDiy(InputStream inputStream); R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TSocialFundInfoSearchVo searchVo); /**
* @Description: 导出
* @Author: hgw
* @Date: 2022/7/26 16:45
* @return: void
**/
void listExport(HttpServletResponse response, TSocialFundInfoSearchVo searchVo);
List<TSocialFundInfo> noPageDiy(TSocialFundInfoSearchVo searchVo); List<TSocialFundInfo> noPageDiy(TSocialFundInfoSearchVo searchVo);
......
...@@ -40,10 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants; ...@@ -40,10 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*; import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.*; import com.yifu.cloud.plus.v1.yifu.social.service.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundHistoryVo; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -99,7 +96,7 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe ...@@ -99,7 +96,7 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
public void listExport(HttpServletResponse response, TSocialFundInfoSearchVo searchVo) { public void listExport(HttpServletResponse response, TSocialFundInfoSearchVo searchVo) {
String fileName = "社保公积金批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "社保公积金批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TSocialFundInfo> list = new ArrayList<>(); List<TSocialFundInfoExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = noPageCountDiy(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
...@@ -115,10 +112,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe ...@@ -115,10 +112,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = export(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<TSocialFundInfo> util = new ExcelUtil<>(TSocialFundInfo.class); ExcelUtil<TSocialFundInfoExportVo> util = new ExcelUtil<>(TSocialFundInfoExportVo.class);
for (TSocialFundInfo vo : list) { for (TSocialFundInfoExportVo vo : list) {
util.convertEntity(vo, null, null, null); util.convertEntity(vo, null, null, null);
} }
} }
...@@ -162,6 +159,14 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe ...@@ -162,6 +159,14 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
private List<TSocialFundInfoExportVo> export(TSocialFundInfoSearchVo searchVo) {
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
searchVo.setIdList(idList);
}
return baseMapper.exportList(searchVo);
}
private Long noPageCountDiy(TSocialFundInfoSearchVo searchVo) { private Long noPageCountDiy(TSocialFundInfoSearchVo searchVo) {
LambdaQueryWrapper<TSocialFundInfo> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TSocialFundInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList = Common.getList(searchVo.getIds());
......
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