Commit 1675d947 authored by huyuchen's avatar huyuchen

优化修改

parent 9f61f549
...@@ -76,6 +76,7 @@ public class TSalaryAccountPhoneController { ...@@ -76,6 +76,7 @@ public class TSalaryAccountPhoneController {
.eq(TSalaryAccount::getEmpIdcard, idNumber) .eq(TSalaryAccount::getEmpIdcard, idNumber)
.eq(TSalaryAccount::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TSalaryAccount::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TSalaryAccount::getSendStatus, CommonConstants.ONE_STRING) .eq(TSalaryAccount::getSendStatus, CommonConstants.ONE_STRING)
.eq(TSalaryAccount::getPaySettleFlag, CommonConstants.ZERO_STRING)
.last(SORT_COL.concat(CommonConstants.LAST_ONE_SQL))); .last(SORT_COL.concat(CommonConstants.LAST_ONE_SQL)));
//查实发工资 //查实发工资
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
...@@ -89,6 +90,7 @@ public class TSalaryAccountPhoneController { ...@@ -89,6 +90,7 @@ public class TSalaryAccountPhoneController {
.eq(TSalaryAccount::getEmpIdcard, idNumber) .eq(TSalaryAccount::getEmpIdcard, idNumber)
.eq(TSalaryAccount::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TSalaryAccount::getDeleteFlag, CommonConstants.ZERO_INT)
.eq(TSalaryAccount::getSendStatus, CommonConstants.ONE_STRING) .eq(TSalaryAccount::getSendStatus, CommonConstants.ONE_STRING)
.eq(TSalaryAccount::getPaySettleFlag, CommonConstants.ZERO_STRING)
.likeRight(TSalaryAccount::getSalaryMonth, year).last(SORT_COL)); .likeRight(TSalaryAccount::getSalaryMonth, year).last(SORT_COL));
//查实发工资 //查实发工资
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 缴费库查询导出字段
* @author huyc
* @date 2023-05-18 17:01:22
*/
@Data
public class TPaymentInfoNewExportVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description ="员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称" )
@Schema(description ="客户名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
private String unitName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称" )
@Schema(description ="项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
private String settleDomainName;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地" )
@Schema(description ="社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地")
private String socialPayAddr;
/**
* 缴纳月份
*/
@ExcelAttribute(name = "缴纳月份")
@Schema(description ="缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("缴纳月份")
private String socialPayMonth;
/**
* 生成月份
*/
@ExcelAttribute(name = "生成月份")
@Schema(description ="生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生成月份")
private String socialCreateMonth;
/**
* 养老金额
*/
@ExcelAttribute(name = "养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老金额")
private BigDecimal pensionMoneySum;
/**
* 医疗金额
*/
@ExcelAttribute(name = "医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗金额")
private BigDecimal medicalMoneySum;
/**
* 失业金额
*/
@ExcelAttribute(name = "失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业金额")
private BigDecimal unemploymentMoneySum;
/**
* 工伤金额
*/
@ExcelAttribute(name = "工伤金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤金额")
private BigDecimal unitInjuryMoney;
/**
* 单位生育金额
*/
@ExcelAttribute(name = "生育金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育金额")
private BigDecimal unitBirthMoney;
/**
* 大病金额
*/
@ExcelAttribute(name = "大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("大病金额")
private BigDecimal bigmailmentMoneySum;
/**
* 补缴利息
*/
@ExcelAttribute(name = "补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("补缴利息")
private BigDecimal accrualSum;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户" )
@Schema(description ="社保户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保户")
private String socialHousehold;
/**
* 社保合计
*/
@ExcelAttribute(name = "社保合计" )
@Schema(description ="社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保合计")
private BigDecimal socialSum;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户" )
@Schema(description ="公积金户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金户")
private String providentHousehold;
/**
* 公积金缴纳地
*/
@ExcelAttribute(name = "公积金缴纳地" )
@Schema(description ="公积金缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地")
private String providentPayAddr;
/**
* 公积金合计
*/
@ExcelAttribute(name = "公积金合计" )
@Schema(description ="公积金合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金合计")
private BigDecimal providentSum;
/**
* 总合计
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/**
* 分组键
*/
@ExcelAttribute(name = "分组键", isExport = false)
@Schema(description = "分组键")
private String keyGroup;
}
...@@ -70,19 +70,10 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable { ...@@ -70,19 +70,10 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable {
@ExcelProperty("项目名称") @ExcelProperty("项目名称")
private String settleDomainName; private String settleDomainName;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户" )
@Schema(description ="社保户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保户")
private String socialHousehold;
/** /**
* 社保编号 * 社保编号
*/ */
@ExcelAttribute(name = "社保编号" ) @ExcelAttribute(name = "社保编号", isExport = false)
@Schema(description ="社保编号") @Schema(description ="社保编号")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保编号") @ExcelProperty("社保编号")
...@@ -116,49 +107,13 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable { ...@@ -116,49 +107,13 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable {
private String socialCreateMonth; private String socialCreateMonth;
/** /**
* 总合计 * 社保户
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/**
* 公积金缴纳月份
*/
@ExcelAttribute(name = "公积金缴纳月份")
@Schema(description ="公积金缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
/**
* 公积金生成月份
*/
@ExcelAttribute(name = "公积金生成月份")
@Schema(description ="公积金生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户" )
@Schema(description ="公积金户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金户")
private String providentHousehold;
/**
* 公积金缴纳地
*/ */
@ExcelAttribute(name = "公积金缴纳地" ) @ExcelAttribute(name = "社保户" )
@Schema(description ="公积金缴纳地") @Schema(description ="社保户")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地") @ExcelProperty("社保户")
private String providentPayAddr; private String socialHousehold;
/** /**
* 社保合计 * 社保合计
...@@ -188,13 +143,22 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable { ...@@ -188,13 +143,22 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable {
private BigDecimal socialSecurityPersonalSum; private BigDecimal socialSecurityPersonalSum;
/** /**
* 公积金总合计 * 单位社保公积金合计
*/ */
@ExcelAttribute(name = "公积金总合计" ) @ExcelAttribute(name = "单位社保公积金合计" )
@Schema(description ="公积金总合计") @Schema(description ="单位社保公积金合计")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金总合计") @ExcelProperty("单位社保公积金合计")
private BigDecimal providentSum; private BigDecimal unitSocialFundSum;
/**
* 个人社保公积金合计
*/
@ExcelAttribute(name = "个人社保公积金合计" )
@Schema(description ="个人社保公积金合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保公积金合计")
private BigDecimal socialFundPersonalSum;
/** /**
* 单位社保补缴利息 * 单位社保补缴利息
...@@ -287,6 +251,7 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable { ...@@ -287,6 +251,7 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病金额") @ExcelProperty("单位大病金额")
private BigDecimal unitBigmailmentMoney; private BigDecimal unitBigmailmentMoney;
/** /**
* 个人养老金额 * 个人养老金额
*/ */
...@@ -315,6 +280,42 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable { ...@@ -315,6 +280,42 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额") @ExcelProperty("个人大病金额")
private BigDecimal personalBigmailmentMoney; private BigDecimal personalBigmailmentMoney;
/**
* 养老金额
*/
@ExcelAttribute(name = "养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老金额")
private BigDecimal pensionMoneySum;
/**
* 医疗金额
*/
@ExcelAttribute(name = "医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗金额")
private BigDecimal medicalMoneySum;
/**
* 失业金额
*/
@ExcelAttribute(name = "失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业金额")
private BigDecimal unemploymentMoneySum;
/**
* 大病金额
*/
@ExcelAttribute(name = "大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("大病金额")
private BigDecimal bigmailmentMoneySum;
/**
* 补缴利息
*/
@ExcelAttribute(name = "补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("补缴利息")
private BigDecimal accrualSum;
/** /**
* 公积金编号 * 公积金编号
*/ */
...@@ -358,6 +359,42 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable { ...@@ -358,6 +359,42 @@ public class TPaymentInfoNewVo extends RowIndex implements Serializable {
@ExcelProperty("个人公积金费用") @ExcelProperty("个人公积金费用")
private BigDecimal personalProvidentSum; private BigDecimal personalProvidentSum;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户" )
@Schema(description ="公积金户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金户")
private String providentHousehold;
/**
* 公积金缴纳地
*/
@ExcelAttribute(name = "公积金缴纳地" )
@Schema(description ="公积金缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地")
private String providentPayAddr;
/**
* 公积金合计
*/
@ExcelAttribute(name = "公积金合计" )
@Schema(description ="公积金合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金合计")
private BigDecimal providentSum;
/**
* 总合计
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/** /**
* 分组键 * 分组键
*/ */
......
...@@ -12,4 +12,5 @@ public class PaymentConstants { ...@@ -12,4 +12,5 @@ public class PaymentConstants {
public static final String INJURY_RISK = "工伤保险"; public static final String INJURY_RISK = "工伤保险";
public static final String MEDICAL = "医疗"; public static final String MEDICAL = "医疗";
public static final String EXPORT = "缴费库合并导出"; public static final String EXPORT = "缴费库合并导出";
public static final String SEARCH_EXPORT = "缴费库查询合并导出";
} }
...@@ -303,6 +303,19 @@ public class TPaymentInfoController { ...@@ -303,6 +303,19 @@ public class TPaymentInfoController {
tPaymentInfoService.listSumExport(response, searchVo); tPaymentInfoService.listSumExport(response, searchVo);
} }
/**
* 缴费库查询合并导出
*
* @author huyc
* @date 2023-05-19
**/
@Operation(description = "缴费库查询合并导出 hasPermission('social_tpaymentinfo_export')")
@PostMapping("/sumSearchExport")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void sumSearchExport(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.sumSearchExport(response, searchVo);
}
/** /**
* 根据条件批量删除 * 根据条件批量删除
* *
......
...@@ -67,6 +67,13 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> { ...@@ -67,6 +67,13 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/ */
Integer selectCountTPaymentInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); Integer selectCountTPaymentInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
Integer selectCountPaymentSearchInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/** /**
* 缴费库简单分页查询 * 缴费库简单分页查询
* @param searchVo 缴费库 * @param searchVo 缴费库
...@@ -102,6 +109,13 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> { ...@@ -102,6 +109,13 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/ */
List<TPaymentInfoExportVo> getTPaymentInfoSumNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); List<TPaymentInfoExportVo> getTPaymentInfoSumNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库查询详情
* @param tPaymentInfo
* @return
*/
List<TPaymentInfoNewExportVo> getTPaymentInfoNewExportInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/** /**
* 更新社保或者公积金 * 更新社保或者公积金
* @param tPaymentInfo 缴费库 * @param tPaymentInfo 缴费库
......
...@@ -97,6 +97,14 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> { ...@@ -97,6 +97,14 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/ */
void listSumExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo); void listSumExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/**
* 合并导出缴费库查询
* @param response
* @param searchVo
* @return
*/
void sumSearchExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/** /**
* 删除缴费库数据 包括明细 * 删除缴费库数据 包括明细
* @Author huyc * @Author huyc
......
...@@ -290,6 +290,65 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -290,6 +290,65 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
/**
* 缴费库查询批量导出
*
* @param searchVo 缴费库
* @return
*/
@Override
public void sumSearchExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo) {
String fileName = PaymentConstants.SEARCH_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TPaymentInfoNewExportVo> list = new ArrayList<>();
Integer count = baseMapper.selectCountPaymentSearchInfo(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfoNewExportVo.class).includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPaymentInfoNewExportInfo(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet(PaymentConstants.SEARCH_EXPORT + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet(PaymentConstants.SEARCH_EXPORT + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override @Override
public R<Boolean> removeInFoById(String id) { public R<Boolean> removeInFoById(String id) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
......
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