Commit 901b5cf3 authored by hongguangwu's avatar hongguangwu

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

parents 9fd50f62 78641b79
......@@ -32,6 +32,14 @@ public class EkpPushSocialParam implements Serializable {
* 项目名称
**/
private String fd_3adfe8c8468e54;
/**
* 项目编码-原
**/
private String fd_3cfe2da7e35daa;
/**
* 项目名称-原
**/
private String fd_3cfe2db5015d6e;
/**
* 单号
**/
......
......@@ -261,6 +261,10 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
socialInfo.setFd_3adfe8c70d3fd4(socialParam.getFd_3adfe8c70d3fd4());
//项目名称
socialInfo.setFd_3adfe8c8468e54(socialParam.getFd_3adfe8c8468e54());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(socialParam.getFd_3adfe8c70d3fd4());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(socialParam.getFd_3adfe8c8468e54());
//单号
socialInfo.setFd_3adfe95c169c48(socialParam.getFd_3adfe95c169c48());
//客户编码
......
......@@ -451,9 +451,17 @@ public class TSalaryStandard extends BaseEntity {
*/
@Schema(description = "收入月份")
private String incomeMonth;
//方案名称ID
@Schema(description = "配置ID")
private String setId;
//方案名称
@Schema(description = "方案名称")
private String setName;
//原表类型
@Schema(description = "原表类型")
private String originalSetName;
@Schema(description = "删除人(汉字名)")
private String deleteUser;
@Schema(description = "删除时间")
......
......@@ -44,4 +44,10 @@ public class SalaryUploadParamVo {
// 表格类型 0 薪资原表 1 系统模板
String excelType;
// 方案名称
String setName;
// 原表类型
String originalSetName;
}
/*
* 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.salary.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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryTypeFourExportEkpVo {
//薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// 开户行省,开户行市,开户行支行,稿酬,个税,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
@ExcelProperty("薪酬状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String status;
@ExcelProperty("项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptName;
@ExcelProperty("项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptNo;
@ExcelProperty("发放月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String settlementMonth;
@ExcelProperty("薪酬月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String salaryMonth;
@ExcelProperty("员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
private String empName;
@ExcelProperty("身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
private String empIdcard;
@ExcelProperty("手机号码")
@HeadFontStyle(fontHeightInPoints = 11)
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankName;
// 开户行省
@ExcelProperty("开户行省")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankSubName;
// 劳务费 应发薪酬(劳务费、稿酬)
@ExcelProperty("稿酬")
@HeadFontStyle(fontHeightInPoints = 11)
private String relaySalary;
/**
* 个税金额(个人承担)
*/
@ExcelProperty("个税")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal salaryTax;
/**
* 实发(个人实收)
*/
@ExcelProperty("个人实收")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal actualSalary;
//稿酬,个税,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
@HeadFontStyle(fontHeightInPoints = 11)
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String ownFlag;
//劳务费、稿酬是否含有发薪0:否;1:是
@ExcelProperty("是否发薪员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String haveSalaryFlag;
@ExcelProperty("支出结算状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String paySettleFlag;
}
/*
* 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.salary.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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryTypeThreeExportEkpVo {
//薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// 开户行省,开户行市,开户行支行,劳务费,工资发放时间,是否个人承担部分税费
// 个税-个人承担,个税-单位承担,公司应发,个人实收,本月是否重复金额,是否自有员工,是否发薪员工,支出结算状态
@ExcelProperty("薪酬状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String status;
@ExcelProperty("项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptName;
@ExcelProperty("项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
private String deptNo;
@ExcelProperty("发放月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String settlementMonth;
@ExcelProperty("薪酬月份")
@HeadFontStyle(fontHeightInPoints = 11)
private String salaryMonth;
@ExcelProperty("员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
private String empName;
@ExcelProperty("身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
private String empIdcard;
@ExcelProperty("手机号码")
@HeadFontStyle(fontHeightInPoints = 11)
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankName;
// 开户行省
@ExcelProperty("开户行省")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
@HeadFontStyle(fontHeightInPoints = 11)
private String bankSubName;
// 劳务费 应发薪酬(劳务费、稿酬)
@ExcelProperty("劳务费")
@HeadFontStyle(fontHeightInPoints = 11)
private String relaySalary;
// 工资发放时间(0立即发、1暂停发)
@ExcelProperty("工资发放时间")
@HeadFontStyle(fontHeightInPoints = 11)
private String salaryGiveTime;
/**
* 是否个人承担部分税费
* 公司承担全部税费0
* 个人承担部分税费1
* 个人承担全部税费2
*/
@ExcelProperty("是否个人承担部分税费")
@HeadFontStyle(fontHeightInPoints = 11)
private String isPersonTax;
/**
* 个税金额(个人承担)
*/
@ExcelProperty("个税-个人承担")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal salaryTax;
/**
* 个税-单位承担
*/
@ExcelProperty("个税-单位承担")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal salaryTaxUnit;
/**
* 公司应发
*/
@ExcelProperty("公司应发")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal relaySalaryUnit;
/**
* 实发(个人实收)
*/
@ExcelProperty("个人实收")
@HeadFontStyle(fontHeightInPoints = 11)
private BigDecimal actualSalary;
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
@HeadFontStyle(fontHeightInPoints = 11)
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String ownFlag;
//劳务费、稿酬是否含有发薪0:否;1:是
@ExcelProperty("是否发薪员工")
@HeadFontStyle(fontHeightInPoints = 11)
private String haveSalaryFlag;
@ExcelProperty("支出结算状态")
@HeadFontStyle(fontHeightInPoints = 11)
private String paySettleFlag;
}
......@@ -197,4 +197,7 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/
List<TSalaryAccount> allYearExport(@Param("tSalaryAccount") TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo);
List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo);
}
......@@ -213,4 +213,8 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
TSalaryAccountSumVo getAccountSumBySalaryId(String salaryId);
List<TSalaryAccount> allYearExport(TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo);
List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo);
}
......@@ -299,6 +299,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
s.setBusinessThirdType(dept.getBusinessThirdType());
if (configSalary != null) {
s.setSetId(configSalary.getId());
s.setSetName(configSalary.getName());
if (Common.isNotNull(configSalary.getIncomeMonth())) {
s.setIncomeMonth(DateUtil.addMonth(configSalary.getIncomeMonth()));
}
......@@ -352,6 +353,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (Common.isNotNull(vo.getExcelType())) {
salary.setExcelType(vo.getExcelType());
}
if (Common.isNotNull(vo.getOriginalSetName())){
salary.setOriginalSetName(vo.getOriginalSetName());
}
// 薪资导入、删除前加锁:
TSalaryLock lock = salaryLockService.lambdaQuery()
.eq(TSalaryLock::getDeptId, dept.getId())
......
......@@ -396,4 +396,14 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
public List<TSalaryAccount> allYearExport(TSalaryAccountSearchVo tSalaryAccount) {
return baseMapper.allYearExport(tSalaryAccount);
}
@Override
public List<TSalaryTypeThreeExportEkpVo> getAccountThreeListByApplyNo(String applyNo) {
return baseMapper.getAccountThreeListByApplyNo(applyNo);
}
@Override
public List<TSalaryTypeFourExportEkpVo> getAccountFourListByApplyNo(String applyNo) {
return baseMapper.getAccountFourListByApplyNo(applyNo);
}
}
......@@ -30,14 +30,19 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAttaMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeFourExportEkpVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeThreeExportEkpVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -291,46 +296,79 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
* @Date: 2024/4/18 17:05
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo
**/
@Async
@Override
public synchronized SalaryAttaVo getSalaryAccountToExcel(String applyNo) {
SalaryAttaVo returnVo = new SalaryAttaVo();
List<TSalaryAccountExportByEkpVo> accountList = tSalaryAccountService.getAccountListByApplyNo(applyNo);
if (accountList != null) {
String filePath = "salaryAccountFile";
String fileName = "薪资报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String key = filePath + "/" + fileName;
EasyExcelFactory.write(filePath, TSalaryAccountExportByEkpVo.class).sheet("薪资报表生成").doWrite(accountList);
try {
File file = new File(filePath);
InputStream inputStream = new FileInputStream(file);
// 调用上传服务
boolean flag = ossUtil.uploadFileByStream(inputStream, key,null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TSalaryAtta salaryAtta = this.saveTSalaryAtta(fileName, key, file.length(), applyNo, 14, null, null, null);
try {
this.save(salaryAtta);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
}
URL url = ossUtil.getObjectUrl(null, salaryAtta.getAttaSrc());
returnVo.setAttaUrl(url.toString());
returnVo.setAttaName(salaryAtta.getAttaName());
return returnVo;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除临时文件
TSalaryStandard standard = tSalaryStandardService.getOne(Wrappers.<TSalaryStandard>query().lambda()
.eq(TSalaryStandard::getApplyNo,applyNo).last(CommonConstants.LAST_ONE_SQL));
// 默认薪资
String formType = CommonConstants.ZERO_STRING;
String preFileName = "薪资";
if (Common.isNotNull(standard)){
formType = standard.getFormType();
}
//薪资
if (CommonConstants.ZERO_STRING.equals(formType)){
List<TSalaryAccountExportByEkpVo> accountList = tSalaryAccountService.getAccountListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryAccountExportByEkpVo.class);
}
}
//劳务费
if (CommonConstants.THREE_STRING.equals(formType)){
List<TSalaryTypeThreeExportEkpVo> accountList = tSalaryAccountService.getAccountThreeListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryTypeThreeExportEkpVo.class);
}
}
//稿酬
if (CommonConstants.FOUR_STRING.equals(formType)){
List<TSalaryTypeFourExportEkpVo> accountList = tSalaryAccountService.getAccountFourListByApplyNo(applyNo);
if (accountList != null) {
returnVo = getSalaryAttaVo(applyNo, returnVo, preFileName, accountList,TSalaryTypeFourExportEkpVo.class);
}
}
return returnVo;
}
private <T> SalaryAttaVo getSalaryAttaVo(String applyNo, SalaryAttaVo returnVo, String preFileName, List<T> accountList,Class<T> tClass) {
String filePath = "salaryAccountFile";
String fileName = preFileName + "报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String key = filePath + "/" + fileName;
;
EasyExcelFactory.write(filePath, tClass).sheet(preFileName + "报表生成").doWrite(accountList);
try {
File file = new File(filePath);
InputStream inputStream = new FileInputStream(file);
// 调用上传服务
boolean flag = ossUtil.uploadFileByStream(inputStream, key,null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TSalaryAtta salaryAtta = this.saveTSalaryAtta(fileName, key, file.length(), applyNo, 14, null, null, null);
try {
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
} catch (IOException e) {
e.printStackTrace();
this.save(salaryAtta);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
}
URL url = ossUtil.getObjectUrl(null, salaryAtta.getAttaSrc());
returnVo.setAttaUrl(url.toString());
returnVo.setAttaName(salaryAtta.getAttaName());
return returnVo;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除临时文件
try {
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
} catch (IOException e) {
e.printStackTrace();
}
}
return returnVo;
return null;
}
}
......@@ -574,6 +574,25 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
**/
private HashMap<String, Object> setSendEkpStandardParam(TSalaryStandard s) {
HashMap<String, Object> sendMap = new HashMap<>();
//表单类型 fd_3cfb06799adc3a 表单类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬 fxj 20240523
if (CommonConstants.ZERO_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "薪资");
}
if (CommonConstants.ONE_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "绩效");
}
if (CommonConstants.TWO_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "其他");
}
if (CommonConstants.THREE_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "劳务费");
}
if (CommonConstants.FOUR_STRING.equals(s.getFormType())){
sendMap.put("fd_3cfb06799adc3a", "稿酬");
}
//表格类型 fd_3cfb067af80082 表格类型 0 薪资原表 1 系统模板 fxj 20240523
sendMap.put("fd_3cfb067af80082", CommonConstants.ZERO_STRING.equals(s.getExcelType())?"薪资原表":"系统模板");
sendMap.put("fd_3b3bf2c3b1a6cc", s.getDeptName());
sendMap.put("fd_3b3bf2c426cfc8", s.getDeptNo());
sendMap.put("fd_3b3bf2c4975776", s.getApplyNo() == null ? "" : s.getApplyNo());
......@@ -658,6 +677,10 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
socialParam.setFd_3adfe8c70d3fd4(account.getFd_3adfedf98ccba2());
//项目名称
socialParam.setFd_3adfe8c8468e54(account.getFd_3adfedf9d2bf1c());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(account.getFd_3adfedf98ccba2());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(account.getFd_3adfedf9d2bf1c());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......
......@@ -1409,4 +1409,80 @@
order by a.SALARY_MONTH desc
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountThreeListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeThreeExportEkpVo">
select
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
a.EMP_PHONE as empPhone,
a.BANK_NO as bankNo,
a.BANK_NAME as bankName,
ap.AREA_NAME as bankProvince,
ac.AREA_NAME as bankCity,
a.BANK_SUB_NAME as bankSubName,
a.RELAY_SALARY as relaySalary,
if(a.SALARY_GIVE_TIME='1','暂停发','立即发') as salaryGiveTime,
if(a.IS_PERSON_TAX='1','个人承担部分税费',if(a.IS_PERSON_TAX='2','个人承担全部税费','公司承担全部税费')) as isPersonTax,
a.SALARY_TAX as salaryTax,
a.SALARY_TAX_UNIT as salaryTaxUnit,
a.RELAY_SALARY_UNIT as relaySalaryUnit,
a.ACTUAL_SALARY as actualSalary,
if(a.IS_REPEAT='0','否','是') as isRepeat,
if(a.OWN_FLAG='0','否','是') as ownFlag,
if(a.HAVE_SALARY_FLAG='0','否','是') as haveSalaryFlag,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag
from
t_salary_account a
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountFourListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryTypeFourExportEkpVo">
select
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
a.EMP_PHONE as empPhone,
a.BANK_NO as bankNo,
a.BANK_NAME as bankName,
ap.AREA_NAME as bankProvince,
ac.AREA_NAME as bankCity,
a.BANK_SUB_NAME as bankSubName,
a.RELAY_SALARY as relaySalary,
a.SALARY_TAX as salaryTax,
a.ACTUAL_SALARY as actualSalary,
if(a.IS_REPEAT='0','否','是') as isRepeat,
if(a.OWN_FLAG='0','否','是') as ownFlag,
if(a.HAVE_SALARY_FLAG='0','否','是') as haveSalaryFlag,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag
from
t_salary_account a
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
</mapper>
......@@ -85,6 +85,8 @@
<result property="deleteUser" column="DELETE_USER"/>
<result property="deleteDate" column="DELETE_DATE"/>
<result property="excelType" column="EXCEL_TYPE"/>
<result property="setName" column="SET_NAME"/>
<result property="originalSetName" column="ORIGINAL_SET_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -147,7 +149,9 @@
a.SET_ID,
a.DELETE_USER,
a.DELETE_DATE,
a.EXCEL_TYPE
a.EXCEL_TYPE,
a.SET_NAME,
a.ORIGINAL_SET_NAME
</sql>
<sql id="tSalaryStandard_where">
<if test="tSalaryStandard != null">
......@@ -298,6 +302,12 @@
<if test="tSalaryStandard.excelType != null and tSalaryStandard.excelType.trim() != ''">
AND a.EXCEL_TYPE = #{tSalaryStandard.excelType}
</if>
<if test="tSalaryStandard.setName != null and tSalaryStandard.setName.trim() != ''">
AND a.SET_NAME = #{tSalaryStandard.setName}
</if>
<if test="tSalaryStandard.originalSetName != null and tSalaryStandard.originalSetName.trim() != ''">
AND a.ORIGINAL_SET_NAME = #{tSalaryStandard.originalSetName}
</if>
</if>
</sql>
<!--tSalaryStandard简单分页查询-->
......
/*
* 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.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
@TableName("t_auto_payment_detail")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化实缴记录表")
public class TAutoPaymentDetail extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelIgnore
@Schema(description = "id")
private String id;
/**
* 是否重新办理 0 是 1 否
*/
@ExcelAttribute(name = "是否重新办理 0 是 1 否", maxLength = 1)
@Length(max = 1, message = "是否重新办理 0 是 1 否不能超过1个字符")
@ExcelProperty("是否重新办理 0 是 1 否")
@Schema(description = "是否重新办理 0 是 1 否")
private String repeatHandleFlag;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "姓名不能超过32个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String empName;
/**
* 证件类型
*/
@ExcelAttribute(name = "证件类型", maxLength = 50)
@Length(max = 50, message = "证件类型不能超过50个字符")
@ExcelProperty("证件类型")
@Schema(description = "证件类型")
private String certType;
/**
* 证件号码
*/
@ExcelAttribute(name = "证件号码", maxLength = 50)
@Length(max = 50, message = "证件号码不能超过50个字符")
@ExcelProperty("证件号码")
@Schema(description = "证件号码")
private String certNum;
/**
* 缴费工资
*/
@ExcelAttribute(name = "缴费工资")
@ExcelProperty("缴费工资")
@Schema(description = "缴费工资")
private BigDecimal paymentSalary;
/**
* 缴费基数
*/
@ExcelAttribute(name = "缴费基数")
@ExcelProperty("缴费基数")
@Schema(description = "缴费基数")
private BigDecimal paymentBase;
/**
* 费率
*/
@ExcelAttribute(name = "费率", maxLength = 10)
@Length(max = 10, message = "费率不能超过10个字符")
@ExcelProperty("费率")
@Schema(description = "费率")
private String rate;
/**
* 应缴费额
*/
@ExcelAttribute(name = "应缴费额")
@ExcelProperty("应缴费额")
@Schema(description = "应缴费额")
private BigDecimal payLimit;
/**
* 人员编号
*/
@ExcelAttribute(name = "人员编号", maxLength = 32)
@Length(max = 32, message = "人员编号不能超过32个字符")
@ExcelProperty("人员编号")
@Schema(description = "人员编号")
private String empCode;
/**
* 险种
*/
@ExcelAttribute(name = "险种", maxLength = 50)
@Length(max = 50, message = "险种不能超过50个字符")
@ExcelProperty("险种")
@Schema(description = "险种")
private String insuranceType;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份", maxLength = 10)
@Length(max = 10, message = "社保缴纳月份不能超过10个字符")
@ExcelProperty("社保缴纳月份")
@Schema(description = "社保缴纳月份")
private String payMonth;
/**
* 社保生成月份
*/
@ExcelAttribute(name = "社保生成月份", maxLength = 10)
@Length(max = 10, message = "社保生成月份不能超过10个字符")
@ExcelProperty("社保生成月份")
@Schema(description = "社保生成月份")
private String createMonth;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地", maxLength = 50)
@Length(max = 50, message = "社保缴纳地不能超过50个字符")
@ExcelProperty("社保缴纳地")
@Schema(description = "社保缴纳地")
private String socialAddress;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", maxLength = 100)
@Length(max = 100, message = "社保户不能超过100个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialSecurityAccount;
/**
* 主表ID
*/
@ExcelAttribute(name = "主表ID", isNotEmpty = true, errorInfo = "主表ID不能为空", maxLength = 32)
@NotBlank(message = "主表ID不能为空")
@Length(max = 32, message = "主表ID不能超过32个字符")
@ExcelIgnore
@Schema(description = "主表ID")
private String parentId;
}
/*
* 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.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
@TableName("t_auto_payment_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化实缴记录表")
public class TAutoPaymentInfo extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 数据整合:1 整合中 2已整合
*/
@ExcelAttribute(name = "数据整合:1 整合中 2已整合", maxLength = 1)
@Length(max = 1, message = "数据整合:1 整合中 2已整合不能超过1个字符")
@ExcelProperty("数据整合:1 整合中 2已整合")
@Schema(description = "数据整合:1 整合中 2已整合")
private String dataIntegrationFlag;
/**
* 系统复核:0复核中1复核成功2复核失败
*/
@ExcelAttribute(name = "系统复核:0复核中1复核成功2复核失败", maxLength = 1)
@Length(max = 1, message = "系统复核:0复核中1复核成功2复核失败不能超过1个字符")
@ExcelProperty("系统复核:0复核中1复核成功2复核失败")
@Schema(description = "系统复核:0复核中1复核成功2复核失败")
private String systemReviewFlag;
/**
* 重新复核状态 0 复核中 1复核成功 2复核失败
*/
@ExcelAttribute(name = "重新复核状态 0 复核中 1复核成功 2复核失败", maxLength = 1)
@Length(max = 1, message = "重新复核状态 0 复核中 1复核成功 2复核失败不能超过1个字符")
@ExcelProperty("重新复核状态 0 复核中 1复核成功 2复核失败")
@Schema(description = "重新复核状态 0 复核中 1复核成功 2复核失败")
private String repeatReviewFlag;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentDetailSearchVo extends TAutoPaymentDetail {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentDetailVo extends RowIndex implements Serializable {
/**
* 是否重新办理 0 是 1 否
*/
@ExcelAttribute(name = "是否重新办理", maxLength = 1,readConverterExp = "0=是,1=否",isNotEmpty = true)
@Schema(description = "是否重新办理 0 是 1 否")
@ExcelProperty("是否重新办理")
private String repeatHandleFlag;
/**
* 姓名
*/
@Length(max = 32, message = "姓名 不能超过32 个字符")
@ExcelAttribute(name = "姓名", maxLength = 32,isNotEmpty = true)
@Schema(description = "姓名")
@ExcelProperty("姓名")
private String empName;
/**
* 证件号码
*/
@ExcelAttribute(name = "证件号码", maxLength = 50,isNotEmpty = true)
@Schema(description = "证件号码")
@ExcelProperty("证件号码")
private String certNum;
/**
* 社保户
*/
@Length(max = 100, message = "社保户 不能超过100 个字符")
@ExcelAttribute(name = "社保户", maxLength = 100,isNotEmpty = true)
@Schema(description = "社保户")
@ExcelProperty("社保户")
private String socialSecurityAccount;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentInfoSearchVo extends TAutoPaymentInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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 org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Data
public class TAutoPaymentInfoVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 数据整合:1 整合中 2已整合
*/
@Length(max = 1, message = "数据整合:1 整合中 2已整合 不能超过1 个字符")
@ExcelAttribute(name = "数据整合:1 整合中 2已整合", maxLength = 1)
@Schema(description = "数据整合:1 整合中 2已整合")
@ExcelProperty("数据整合:1 整合中 2已整合")
private String dataIntegrationFlag;
/**
* 系统复核:0复核中1复核成功2复核失败
*/
@Length(max = 1, message = "系统复核:0复核中1复核成功2复核失败 不能超过1 个字符")
@ExcelAttribute(name = "系统复核:0复核中1复核成功2复核失败", maxLength = 1)
@Schema(description = "系统复核:0复核中1复核成功2复核失败")
@ExcelProperty("系统复核:0复核中1复核成功2复核失败")
private String systemReviewFlag;
/**
* 重新复核状态 0 复核中 1复核成功 2复核失败
*/
@Length(max = 1, message = "重新复核状态 0 复核中 1复核成功 2复核失败 不能超过1 个字符")
@ExcelAttribute(name = "重新复核状态 0 复核中 1复核成功 2复核失败", maxLength = 1)
@Schema(description = "重新复核状态 0 复核中 1复核成功 2复核失败")
@ExcelProperty("重新复核状态 0 复核中 1复核成功 2复核失败")
private String repeatReviewFlag;
/**
* 创建人id
*/
@Length(max = 32, message = "创建人id 不能超过32 个字符")
@ExcelAttribute(name = "创建人id", maxLength = 32)
@Schema(description = "创建人id")
@ExcelProperty("创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Length(max = 32, message = "创建人姓名 不能超过32 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 32)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private Date createTime;
/**
* 更新人id
*/
@Length(max = 32, message = "更新人id 不能超过32 个字符")
@ExcelAttribute(name = "更新人id", maxLength = 32)
@Schema(description = "更新人id")
@ExcelProperty("更新人id")
private String updateBy;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间", isDate = true)
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private Date updateTime;
}
/*
* 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.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentDetailService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentDetailSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tautopaymentdetail")
@Tag(name = "自动化实缴记录表管理")
public class TAutoPaymentDetailController {
private final TAutoPaymentDetailService tAutoPaymentDetailService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TAutoPaymentDetail>> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, TAutoPaymentDetailSearchVo tAutoPaymentDetail) {
return new R<>(tAutoPaymentDetailService.getTAutoPaymentDetailPage(page, tAutoPaymentDetail));
}
/**
* 不分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TAutoPaymentDetail>> getTAutoPaymentDetailNoPage(@RequestBody TAutoPaymentDetailSearchVo tAutoPaymentDetail) {
return R.ok(tAutoPaymentDetailService.noPageDiy(tAutoPaymentDetail));
}
/**
* 通过id查询自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tautopaymentdetail_get')")
@GetMapping("/{id}")
public R<TAutoPaymentDetail> getById(@PathVariable("id") String id) {
return R.ok(tAutoPaymentDetailService.getById(id));
}
/**
* 新增自动化实缴记录表
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return R
*/
@Operation(summary = "新增自动化实缴记录表", description = "新增自动化实缴记录表:hasPermission('social_tautopaymentdetail_add')")
@SysLog("新增自动化实缴记录表")
@PostMapping
public R<Boolean> save(@RequestBody TAutoPaymentDetail tAutoPaymentDetail) {
return R.ok(tAutoPaymentDetailService.save(tAutoPaymentDetail));
}
/**
* 修改自动化实缴记录表
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return R
*/
@Operation(summary = "修改自动化实缴记录表", description = "修改自动化实缴记录表:hasPermission('social_tautopaymentdetail_edit')")
@SysLog("修改自动化实缴记录表")
@PutMapping
public R<Boolean> updateById(@RequestBody TAutoPaymentDetail tAutoPaymentDetail) {
return R.ok(tAutoPaymentDetailService.updateById(tAutoPaymentDetail));
}
/**
* 通过id删除自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除自动化实缴记录表", description = "通过id删除自动化实缴记录表:hasPermission('social_tautopaymentdetail_del')")
@SysLog("通过id删除自动化实缴记录表")
@DeleteMapping("/{id}")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAutoPaymentDetailService.removeById(id));
}
/**
* 自动化实缴记录表 批量导入
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@SneakyThrows
@Operation(description = "标记重新办理数据")
@SysLog("标记重新办理数据")
@PostMapping("/importListAdd")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam String parentId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)) {
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.FUND_IMPORT_HANDLE_LOCK + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key, "10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA + CommonConstants.DOWN_LINE_STRING + e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
return tAutoPaymentDetailService.importDiy(file.getInputStream(),parentId);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
} finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* 自动化实缴记录表 批量导出
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@Operation(description = "导出自动化实缴记录表 hasPermission('social_tautopaymentdetail-export')")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody TAutoPaymentDetailSearchVo searchVo) {
tAutoPaymentDetailService.listExport(response, searchVo);
}
}
/*
* 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.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoSearchVo;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tautopaymentinfo")
@Tag(name = "自动化实缴记录表管理")
public class TAutoPaymentInfoController {
private final TAutoPaymentInfoService tAutoPaymentInfoService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TAutoPaymentInfo>> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, TAutoPaymentInfoSearchVo tAutoPaymentInfo) {
return new R<>(tAutoPaymentInfoService.getTAutoPaymentInfoPage(page, tAutoPaymentInfo));
}
/**
* 不分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TAutoPaymentInfo>> getTAutoPaymentInfoNoPage(@RequestBody TAutoPaymentInfoSearchVo tAutoPaymentInfo) {
return R.ok(tAutoPaymentInfoService.noPageDiy(tAutoPaymentInfo));
}
/**
* 通过id查询自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tautopaymentinfo_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_get')")
public R<TAutoPaymentInfo> getById(@PathVariable("id") String id) {
return R.ok(tAutoPaymentInfoService.getById(id));
}
/**
* 新增自动化实缴记录表
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return R
*/
@Operation(summary = "新增自动化实缴记录表", description = "新增自动化实缴记录表:hasPermission('social_tautopaymentinfo_add')")
@SysLog("新增自动化实缴记录表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_add')")
public R<Boolean> save(@RequestBody TAutoPaymentInfo tAutoPaymentInfo) {
return R.ok(tAutoPaymentInfoService.save(tAutoPaymentInfo));
}
/**
* 修改自动化实缴记录表
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return R
*/
@Operation(summary = "修改自动化实缴记录表", description = "修改自动化实缴记录表:hasPermission('social_tautopaymentinfo_edit')")
@SysLog("修改自动化实缴记录表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_edit')")
public R<Boolean> updateById(@RequestBody TAutoPaymentInfo tAutoPaymentInfo) {
return R.ok(tAutoPaymentInfoService.updateById(tAutoPaymentInfo));
}
/**
* 通过id删除自动化实缴记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除自动化实缴记录表", description = "通过id删除自动化实缴记录表:hasPermission('social_tautopaymentinfo_del')")
@SysLog("通过id删除自动化实缴记录表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tAutoPaymentInfoService.removeById(id));
}
/**
* 自动化实缴记录表 批量导入
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@SneakyThrows
@Operation(description = "批量新增自动化实缴记录表 hasPermission('social_tautopaymentinfo-batch-import')")
@SysLog("批量新增自动化实缴记录表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tAutoPaymentInfoService.importDiy(file.getInputStream());
}
/**
* 自动化实缴记录表 批量导出
*
* @author fxj
* @date 2024-05-24 10:56:42
**/
@Operation(description = "导出自动化实缴记录表 hasPermission('social_tautopaymentinfo-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tautopaymentinfo-export')")
public void export(HttpServletResponse response, @RequestBody TAutoPaymentInfoSearchVo searchVo) {
tAutoPaymentInfoService.listExport(response, searchVo);
}
}
/*
* 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.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Mapper
public interface TAutoPaymentDetailMapper extends BaseMapper<TAutoPaymentDetail> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentDetail> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, @Param("tAutoPaymentDetail") TAutoPaymentDetail tAutoPaymentDetail);
}
/*
* 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.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Mapper
public interface TAutoPaymentInfoMapper extends BaseMapper<TAutoPaymentInfo> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentInfo> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, @Param("tAutoPaymentInfo") TAutoPaymentInfo tAutoPaymentInfo);
}
/*
* 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.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.social.vo.TAutoPaymentDetailSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
public interface TAutoPaymentDetailService extends IService<TAutoPaymentDetail> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentDetail 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentDetail> getTAutoPaymentDetailPage(Page<TAutoPaymentDetail> page, TAutoPaymentDetailSearchVo tAutoPaymentDetail);
R<List<ErrorMessage>> importDiy(InputStream inputStream,String parentId);
void listExport(HttpServletResponse response, TAutoPaymentDetailSearchVo searchVo);
List<TAutoPaymentDetail> noPageDiy(TAutoPaymentDetailSearchVo searchVo);
}
/*
* 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.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.social.vo.TAutoPaymentInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
public interface TAutoPaymentInfoService extends IService<TAutoPaymentInfo> {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
IPage<TAutoPaymentInfo> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, TAutoPaymentInfoSearchVo tAutoPaymentInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TAutoPaymentInfoSearchVo searchVo);
List<TAutoPaymentInfo> noPageDiy(TAutoPaymentInfoSearchVo searchVo);
}
/*
* 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.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoVo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TAutoPaymentInfoService;
import lombok.extern.log4j.Log4j2;
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.R;
import com.yifu.cloud.plus.v1.yifu.social.vo.TAutoPaymentInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 自动化实缴记录表
*
* @author fxj
* @date 2024-05-24 10:56:42
*/
@Log4j2
@Service
public class TAutoPaymentInfoServiceImpl extends ServiceImpl<TAutoPaymentInfoMapper, TAutoPaymentInfo> implements TAutoPaymentInfoService {
/**
* 自动化实缴记录表简单分页查询
*
* @param tAutoPaymentInfo 自动化实缴记录表
* @return
*/
@Override
public IPage<TAutoPaymentInfo> getTAutoPaymentInfoPage(Page<TAutoPaymentInfo> page, TAutoPaymentInfoSearchVo tAutoPaymentInfo) {
return baseMapper.getTAutoPaymentInfoPage(page, tAutoPaymentInfo);
}
/**
* 自动化实缴记录表批量导出
*
* @param searchVo 自动化实缴记录表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TAutoPaymentInfoSearchVo searchVo) {
String fileName = "自动化实缴记录表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TAutoPaymentInfo> list = new ArrayList<>();
long count = noPageCountDiy(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, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TAutoPaymentInfo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TAutoPaymentInfo> util = new ExcelUtil<>(TAutoPaymentInfo.class);
for (TAutoPaymentInfo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("自动化实缴记录表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("自动化实缴记录表" + 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
public List<TAutoPaymentInfo> noPageDiy(TAutoPaymentInfoSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentInfo::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TAutoPaymentInfoSearchVo searchVo) {
LambdaQueryWrapper<TAutoPaymentInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TAutoPaymentInfo::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TAutoPaymentInfoSearchVo entity) {
LambdaQueryWrapper<TAutoPaymentInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TAutoPaymentInfo::getCreateTime, entity.getCreateTimes()[0])
.le(TAutoPaymentInfo::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TAutoPaymentInfo::getCreateName, entity.getCreateName());
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TAutoPaymentInfoVo> util1 = new ExcelUtil<>(TAutoPaymentInfoVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TAutoPaymentInfoVo.class, new ReadListener<TAutoPaymentInfoVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TAutoPaymentInfoVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TAutoPaymentInfoVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTAutoPaymentInfo(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTAutoPaymentInfo(List<TAutoPaymentInfoVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TAutoPaymentInfoVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TAutoPaymentInfoVo excel) {
TAutoPaymentInfo insert = new TAutoPaymentInfo();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
......@@ -567,6 +567,10 @@ public class DoJointSocialTask {
socialParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
socialParam.setFd_3adfe8c8468e54(library.getSettleDomainName());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(library.getSettleDomainCode());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(library.getSettleDomainName());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......@@ -1080,6 +1084,10 @@ public class DoJointSocialTask {
socialParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
socialParam.setFd_3adfe8c8468e54(library.getDeptName());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(library.getDeptNo());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(library.getDeptName());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentDetailMapper">
<resultMap id="tAutoPaymentDetailMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentDetail">
<id property="id" column="ID"/>
<result property="repeatHandleFlag" column="REPEAT_HANDLE_FLAG"/>
<result property="empName" column="EMP_NAME"/>
<result property="certType" column="CERT_TYPE"/>
<result property="certNum" column="CERT_NUM"/>
<result property="paymentSalary" column="PAYMENT_SALARY"/>
<result property="paymentBase" column="PAYMENT_BASE"/>
<result property="rate" column="RATE"/>
<result property="payLimit" column="PAY_LIMIT"/>
<result property="empCode" column="EMP_CODE"/>
<result property="insuranceType" column="INSURANCE_TYPE"/>
<result property="payMonth" column="PAY_MONTH"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="socialAddress" column="SOCIAL_ADDRESS"/>
<result property="socialSecurityAccount" column="SOCIAL_SECURITY_ACCOUNT"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="parentId" column="PARENT_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.REPEAT_HANDLE_FLAG,
a.EMP_NAME,
a.CERT_TYPE,
a.CERT_NUM,
a.PAYMENT_SALARY,
a.PAYMENT_BASE,
a.RATE,
a.PAY_LIMIT,
a.EMP_CODE,
a.INSURANCE_TYPE,
a.PAY_MONTH,
a.CREATE_MONTH,
a.SOCIAL_ADDRESS,
a.SOCIAL_SECURITY_ACCOUNT,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.PARENT_ID
</sql>
<sql id="tAutoPaymentDetail_where">
<if test="tAutoPaymentDetail != null">
<if test="tAutoPaymentDetail.id != null and tAutoPaymentDetail.id.trim() != ''">
AND a.ID = #{tAutoPaymentDetail.id}
</if>
<if test="tAutoPaymentDetail.repeatHandleFlag != null and tAutoPaymentDetail.repeatHandleFlag.trim() != ''">
AND a.REPEAT_HANDLE_FLAG = #{tAutoPaymentDetail.repeatHandleFlag}
</if>
<if test="tAutoPaymentDetail.empName != null and tAutoPaymentDetail.empName.trim() != ''">
AND a.EMP_NAME = #{tAutoPaymentDetail.empName}
</if>
<if test="tAutoPaymentDetail.certType != null and tAutoPaymentDetail.certType.trim() != ''">
AND a.CERT_TYPE = #{tAutoPaymentDetail.certType}
</if>
<if test="tAutoPaymentDetail.certNum != null and tAutoPaymentDetail.certNum.trim() != ''">
AND a.CERT_NUM = #{tAutoPaymentDetail.certNum}
</if>
<if test="tAutoPaymentDetail.paymentSalary != null">
AND a.PAYMENT_SALARY = #{tAutoPaymentDetail.paymentSalary}
</if>
<if test="tAutoPaymentDetail.paymentBase != null">
AND a.PAYMENT_BASE = #{tAutoPaymentDetail.paymentBase}
</if>
<if test="tAutoPaymentDetail.rate != null and tAutoPaymentDetail.rate.trim() != ''">
AND a.RATE = #{tAutoPaymentDetail.rate}
</if>
<if test="tAutoPaymentDetail.payLimit != null">
AND a.PAY_LIMIT = #{tAutoPaymentDetail.payLimit}
</if>
<if test="tAutoPaymentDetail.empCode != null and tAutoPaymentDetail.empCode.trim() != ''">
AND a.EMP_CODE = #{tAutoPaymentDetail.empCode}
</if>
<if test="tAutoPaymentDetail.insuranceType != null and tAutoPaymentDetail.insuranceType.trim() != ''">
AND a.INSURANCE_TYPE = #{tAutoPaymentDetail.insuranceType}
</if>
<if test="tAutoPaymentDetail.payMonth != null and tAutoPaymentDetail.payMonth.trim() != ''">
AND a.PAY_MONTH = #{tAutoPaymentDetail.payMonth}
</if>
<if test="tAutoPaymentDetail.createMonth != null and tAutoPaymentDetail.createMonth.trim() != ''">
AND a.CREATE_MONTH = #{tAutoPaymentDetail.createMonth}
</if>
<if test="tAutoPaymentDetail.socialAddress != null and tAutoPaymentDetail.socialAddress.trim() != ''">
AND a.SOCIAL_ADDRESS = #{tAutoPaymentDetail.socialAddress}
</if>
<if test="tAutoPaymentDetail.socialSecurityAccount != null and tAutoPaymentDetail.socialSecurityAccount.trim() != ''">
AND a.SOCIAL_SECURITY_ACCOUNT = #{tAutoPaymentDetail.socialSecurityAccount}
</if>
<if test="tAutoPaymentDetail.createBy != null and tAutoPaymentDetail.createBy.trim() != ''">
AND a.CREATE_BY = #{tAutoPaymentDetail.createBy}
</if>
<if test="tAutoPaymentDetail.createName != null and tAutoPaymentDetail.createName.trim() != ''">
AND a.CREATE_NAME = #{tAutoPaymentDetail.createName}
</if>
<if test="tAutoPaymentDetail.createTime != null">
AND a.CREATE_TIME = #{tAutoPaymentDetail.createTime}
</if>
<if test="tAutoPaymentDetail.updateBy != null and tAutoPaymentDetail.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tAutoPaymentDetail.updateBy}
</if>
<if test="tAutoPaymentDetail.updateTime != null">
AND a.UPDATE_TIME = #{tAutoPaymentDetail.updateTime}
</if>
<if test="tAutoPaymentDetail.parentId != null and tAutoPaymentDetail.parentId.trim() != ''">
AND a.PARENT_ID = #{tAutoPaymentDetail.parentId}
</if>
</if>
</sql>
<!--tAutoPaymentDetail简单分页查询-->
<select id="getTAutoPaymentDetailPage" resultMap="tAutoPaymentDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_auto_payment_detail a
<where>
1=1
<include refid="tAutoPaymentDetail_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TAutoPaymentInfoMapper">
<resultMap id="tAutoPaymentInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TAutoPaymentInfo">
<id property="id" column="ID"/>
<result property="dataIntegrationFlag" column="DATA_INTEGRATION_FLAG"/>
<result property="systemReviewFlag" column="SYSTEM_REVIEW_FLAG"/>
<result property="repeatReviewFlag" column="REPEAT_REVIEW_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.DATA_INTEGRATION_FLAG,
a.SYSTEM_REVIEW_FLAG,
a.REPEAT_REVIEW_FLAG,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="tAutoPaymentInfo_where">
<if test="tAutoPaymentInfo != null">
<if test="tAutoPaymentInfo.id != null and tAutoPaymentInfo.id.trim() != ''">
AND a.ID = #{tAutoPaymentInfo.id}
</if>
<if test="tAutoPaymentInfo.dataIntegrationFlag != null and tAutoPaymentInfo.dataIntegrationFlag.trim() != ''">
AND a.DATA_INTEGRATION_FLAG = #{tAutoPaymentInfo.dataIntegrationFlag}
</if>
<if test="tAutoPaymentInfo.systemReviewFlag != null and tAutoPaymentInfo.systemReviewFlag.trim() != ''">
AND a.SYSTEM_REVIEW_FLAG = #{tAutoPaymentInfo.systemReviewFlag}
</if>
<if test="tAutoPaymentInfo.repeatReviewFlag != null and tAutoPaymentInfo.repeatReviewFlag.trim() != ''">
AND a.REPEAT_REVIEW_FLAG = #{tAutoPaymentInfo.repeatReviewFlag}
</if>
<if test="tAutoPaymentInfo.createBy != null and tAutoPaymentInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tAutoPaymentInfo.createBy}
</if>
<if test="tAutoPaymentInfo.createName != null and tAutoPaymentInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tAutoPaymentInfo.createName}
</if>
<if test="tAutoPaymentInfo.createTime != null">
AND a.CREATE_TIME = #{tAutoPaymentInfo.createTime}
</if>
<if test="tAutoPaymentInfo.updateBy != null and tAutoPaymentInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tAutoPaymentInfo.updateBy}
</if>
<if test="tAutoPaymentInfo.updateTime != null">
AND a.UPDATE_TIME = #{tAutoPaymentInfo.updateTime}
</if>
</if>
</sql>
<!--tAutoPaymentInfo简单分页查询-->
<select id="getTAutoPaymentInfoPage" resultMap="tAutoPaymentInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_auto_payment_info a
<where>
1=1
<include refid="tAutoPaymentInfo_where"/>
</where>
</select>
</mapper>
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