Commit 1259cba1 authored by hongguangwu's avatar hongguangwu

收入初次提交

parent 81aa66ee
/*
* 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.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Data
@TableName("t_income")
@Schema(description = "收入明细表")
public class TIncome {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
private String id;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名不能为空", maxLength = 32)
@NotBlank(message = "员工姓名不能为空")
@Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32)
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户id
*/
@ExcelAttribute(name = "客户id", maxLength = 32)
@Length(max = 32, message = "客户id不能超过32个字符")
@ExcelProperty("客户id")
private String unitId;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
private String unitName;
/**
* 客户编码
*/
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Length(max = 32, message = "客户编码不能超过32个字符")
@ExcelProperty("客户编码")
private String unitNo;
/**
* 项目id
*/
@ExcelAttribute(name = "项目id", maxLength = 32)
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelProperty("项目id")
private String deptId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 费用类型:1管理费2风险金
*/
@ExcelAttribute(name = "费用类型:1管理费2风险金", maxLength = 1)
@Length(max = 1, message = "费用类型:1管理费2风险金不能超过1个字符")
@ExcelProperty("费用类型:1管理费2风险金")
private String feeType;
/**
* 收费方式:1按比例2金额-人数3金额-人次
*/
@ExcelAttribute(name = "收费方式:1按比例2金额-人数3金额-人次", maxLength = 1)
@Length(max = 1, message = "收费方式:1按比例2金额-人数3金额-人次不能超过1个字符")
@ExcelProperty("收费方式:1按比例2金额-人数3金额-人次")
private String feeMode;
/**
* 收费标准
*/
@ExcelAttribute(name = "收费标准", maxLength = 10)
@Length(max = 10, message = "收费标准不能超过10个字符")
@ExcelProperty("收费标准")
private String charges;
/**
* 收入来源:1社保2公积金3商险4薪资
*/
@ExcelAttribute(name = "收入来源:1社保2公积金3商险4薪资", isNotEmpty = true, errorInfo = "收入来源:1社保2公积金3商险4薪资不能为空", maxLength = 1)
@NotBlank(message = "收入来源:1社保2公积金3商险4薪资不能为空")
@Length(max = 1, message = "收入来源:1社保2公积金3商险4薪资不能超过1个字符")
@ExcelProperty("收入来源:1社保2公积金3商险4薪资")
private String sourceType;
/**
* 金额
*/
@ExcelAttribute(name = "金额", isNotEmpty = true, errorInfo = "金额不能为空")
@NotBlank(message = "金额不能为空")
@ExcelProperty("金额")
private BigDecimal money;
/**
* 生成月份
*/
@ExcelAttribute(name = "生成月份", maxLength = 6)
@Length(max = 6, message = "生成月份不能超过6个字符")
@ExcelProperty("生成月份")
private String createMonth;
/**
* 缴纳月份
*/
@ExcelAttribute(name = "缴纳月份", maxLength = 6)
@Length(max = 6, message = "缴纳月份不能超过6个字符")
@ExcelProperty("缴纳月份")
private String payMonth;
/**
* 数据生成时间
*/
@ExcelAttribute(name = "数据生成时间", isNotEmpty = true, errorInfo = "数据生成时间不能为空", isDate = true)
@NotBlank(message = "数据生成时间不能为空")
@ExcelProperty("数据生成时间")
private Date createTime;
/**
* 数据生成月份
*/
@ExcelAttribute(name = "数据生成月份", maxLength = 6)
@Length(max = 6, message = "数据生成月份不能超过6个字符")
@ExcelProperty("数据生成月份")
private String dataCreateMonth;
/**
* 推送状态:0未推送1已推送
*/
@ExcelAttribute(name = "推送状态:0未推送1已推送", maxLength = 1)
@Length(max = 1, message = "推送状态:0未推送1已推送不能超过1个字符")
@ExcelProperty("推送状态:0未推送1已推送")
private String pushStatus;
}
/*
* 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.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
/**
* 收入明细表-全部明细
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Data
@TableName("t_income_detail")
@Schema(description = "收入明细表-全部明细")
public class TIncomeDetail {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
private String id;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名不能为空", maxLength = 32)
@NotBlank(message = "员工姓名不能为空")
@Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32)
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户id
*/
@ExcelAttribute(name = "客户id", maxLength = 32)
@Length(max = 32, message = "客户id不能超过32个字符")
@ExcelProperty("客户id")
private String unitId;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
private String unitName;
/**
* 客户编码
*/
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Length(max = 32, message = "客户编码不能超过32个字符")
@ExcelProperty("客户编码")
private String unitNo;
/**
* 项目id
*/
@ExcelAttribute(name = "项目id", maxLength = 32)
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelProperty("项目id")
private String deptId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 费用类型:1管理费2风险金
*/
@ExcelAttribute(name = "费用类型:1管理费2风险金", maxLength = 1)
@Length(max = 1, message = "费用类型:1管理费2风险金不能超过1个字符")
@ExcelProperty("费用类型:1管理费2风险金")
private String feeType;
/**
* 收费方式:1按比例2金额-人数3金额-人次
*/
@ExcelAttribute(name = "收费方式:1按比例2金额-人数3金额-人次", maxLength = 1)
@Length(max = 1, message = "收费方式:1按比例2金额-人数3金额-人次不能超过1个字符")
@ExcelProperty("收费方式:1按比例2金额-人数3金额-人次")
private String feeMode;
/**
* 收费标准
*/
@ExcelAttribute(name = "收费标准", maxLength = 10)
@Length(max = 10, message = "收费标准不能超过10个字符")
@ExcelProperty("收费标准")
private String charges;
/**
* 收入来源:1社保2公积金3商险4薪资
*/
@ExcelAttribute(name = "收入来源:1社保2公积金3商险4薪资", isNotEmpty = true, errorInfo = "收入来源:1社保2公积金3商险4薪资不能为空", maxLength = 1)
@NotBlank(message = "收入来源:1社保2公积金3商险4薪资不能为空")
@Length(max = 1, message = "收入来源:1社保2公积金3商险4薪资不能超过1个字符")
@ExcelProperty("收入来源:1社保2公积金3商险4薪资")
private String sourceType;
/**
* 金额
*/
@ExcelAttribute(name = "金额", isNotEmpty = true, errorInfo = "金额不能为空")
@NotBlank(message = "金额不能为空")
@ExcelProperty("金额")
private BigDecimal money;
/**
* 生成月份
*/
@ExcelAttribute(name = "生成月份", maxLength = 6)
@Length(max = 6, message = "生成月份不能超过6个字符")
@ExcelProperty("生成月份")
private String createMonth;
/**
* 缴纳月份
*/
@ExcelAttribute(name = "缴纳月份", maxLength = 6)
@Length(max = 6, message = "缴纳月份不能超过6个字符")
@ExcelProperty("缴纳月份")
private String payMonth;
/**
* 数据生成时间
*/
@ExcelAttribute(name = "数据生成时间", isNotEmpty = true, errorInfo = "数据生成时间不能为空", isDate = true)
@NotBlank(message = "数据生成时间不能为空")
@ExcelProperty("数据生成时间")
private Date createTime;
/**
* 数据生成月份
*/
@ExcelAttribute(name = "数据生成月份", maxLength = 6)
@Length(max = 6, message = "数据生成月份不能超过6个字符")
@ExcelProperty("数据生成月份")
private String dataCreateMonth;
/**
* 来源id,红冲使用
*/
@ExcelAttribute(name = "来源id,红冲使用", isNotEmpty = true, errorInfo = "来源id,红冲使用不能为空", maxLength = 32)
@NotBlank(message = "来源id,红冲使用不能为空")
@Length(max = 32, message = "来源id,红冲使用不能超过32个字符")
@ExcelProperty("来源id,红冲使用")
private String sourceId;
}
/*
* 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.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 收入明细表-全部明细
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Data
public class TIncomeDetailSearchVo extends TIncomeDetail {
/**
* 多选导出或删除等操作
*/
@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.math.BigDecimal;
import java.util.Date;
/**
* 收入明细表-全部明细
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Data
public class TIncomeDetailVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 32, message = "主键 不能超过32 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 32)
@Schema(description = "主键")
@ExcelProperty("主键")
private String id;
/**
* 员工姓名
*/
@NotBlank(message = "员工姓名 不能为空")
@Length(max = 32, message = "员工姓名 不能超过32 个字符")
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名 不能为空", maxLength = 32)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@NotBlank(message = "身份证号 不能为空")
@Length(max = 32, message = "身份证号 不能超过32 个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 32)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户id
*/
@Length(max = 32, message = "客户id 不能超过32 个字符")
@ExcelAttribute(name = "客户id", maxLength = 32)
@Schema(description = "客户id")
@ExcelProperty("客户id")
private String unitId;
/**
* 客户名称
*/
@Length(max = 50, message = "客户名称 不能超过50 个字符")
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Schema(description = "客户名称")
@ExcelProperty("客户名称")
private String unitName;
/**
* 客户编码
*/
@Length(max = 32, message = "客户编码 不能超过32 个字符")
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Schema(description = "客户编码")
@ExcelProperty("客户编码")
private String unitNo;
/**
* 项目id
*/
@Length(max = 32, message = "项目id 不能超过32 个字符")
@ExcelAttribute(name = "项目id", maxLength = 32)
@Schema(description = "项目id")
@ExcelProperty("项目id")
private String deptId;
/**
* 项目名称
*/
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@Length(max = 30, message = "项目编码 不能超过30 个字符")
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 费用类型:1管理费2风险金
*/
@Length(max = 1, message = "费用类型:1管理费2风险金 不能超过1 个字符")
@ExcelAttribute(name = "费用类型:1管理费2风险金", maxLength = 1)
@Schema(description = "费用类型:1管理费2风险金")
@ExcelProperty("费用类型:1管理费2风险金")
private String feeType;
/**
* 收费方式:1按比例2金额-人数3金额-人次
*/
@Length(max = 1, message = "收费方式:1按比例2金额-人数3金额-人次 不能超过1 个字符")
@ExcelAttribute(name = "收费方式:1按比例2金额-人数3金额-人次", maxLength = 1)
@Schema(description = "收费方式:1按比例2金额-人数3金额-人次")
@ExcelProperty("收费方式:1按比例2金额-人数3金额-人次")
private String feeMode;
/**
* 收费标准
*/
@Length(max = 10, message = "收费标准 不能超过10 个字符")
@ExcelAttribute(name = "收费标准", maxLength = 10)
@Schema(description = "收费标准")
@ExcelProperty("收费标准")
private String charges;
/**
* 收入来源:1社保2公积金3商险4薪资
*/
@NotBlank(message = "收入来源:1社保2公积金3商险4薪资 不能为空")
@Length(max = 1, message = "收入来源:1社保2公积金3商险4薪资 不能超过1 个字符")
@ExcelAttribute(name = "收入来源:1社保2公积金3商险4薪资", isNotEmpty = true, errorInfo = "收入来源:1社保2公积金3商险4薪资 不能为空", maxLength = 1)
@Schema(description = "收入来源:1社保2公积金3商险4薪资")
@ExcelProperty("收入来源:1社保2公积金3商险4薪资")
private String sourceType;
/**
* 金额
*/
@NotBlank(message = "金额 不能为空")
@ExcelAttribute(name = "金额", isNotEmpty = true, errorInfo = "金额 不能为空")
@Schema(description = "金额")
@ExcelProperty("金额")
private BigDecimal money;
/**
* 生成月份
*/
@Length(max = 6, message = "生成月份 不能超过6 个字符")
@ExcelAttribute(name = "生成月份", maxLength = 6)
@Schema(description = "生成月份")
@ExcelProperty("生成月份")
private String createMonth;
/**
* 缴纳月份
*/
@Length(max = 6, message = "缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "缴纳月份", maxLength = 6)
@Schema(description = "缴纳月份")
@ExcelProperty("缴纳月份")
private String payMonth;
/**
* 数据生成时间
*/
@NotBlank(message = "数据生成时间 不能为空")
@ExcelAttribute(name = "数据生成时间", isNotEmpty = true, errorInfo = "数据生成时间 不能为空", isDate = true)
@Schema(description = "数据生成时间")
@ExcelProperty("数据生成时间")
private Date createTime;
/**
* 数据生成月份
*/
@Length(max = 6, message = "数据生成月份 不能超过6 个字符")
@ExcelAttribute(name = "数据生成月份", maxLength = 6)
@Schema(description = "数据生成月份")
@ExcelProperty("数据生成月份")
private String dataCreateMonth;
/**
* 来源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 sourceId;
}
/*
* 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.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Data
public class TIncomeSearchVo extends TIncome {
/**
* 多选导出或删除等操作
*/
@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.math.BigDecimal;
import java.util.Date;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Data
public class TIncomeVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 32, message = "主键 不能超过32 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 32)
@Schema(description = "主键")
@ExcelProperty("主键")
private String id;
/**
* 员工姓名
*/
@NotBlank(message = "员工姓名 不能为空")
@Length(max = 32, message = "员工姓名 不能超过32 个字符")
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名 不能为空", maxLength = 32)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@NotBlank(message = "身份证号 不能为空")
@Length(max = 32, message = "身份证号 不能超过32 个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 32)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户id
*/
@Length(max = 32, message = "客户id 不能超过32 个字符")
@ExcelAttribute(name = "客户id", maxLength = 32)
@Schema(description = "客户id")
@ExcelProperty("客户id")
private String unitId;
/**
* 客户名称
*/
@Length(max = 50, message = "客户名称 不能超过50 个字符")
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Schema(description = "客户名称")
@ExcelProperty("客户名称")
private String unitName;
/**
* 客户编码
*/
@Length(max = 32, message = "客户编码 不能超过32 个字符")
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Schema(description = "客户编码")
@ExcelProperty("客户编码")
private String unitNo;
/**
* 项目id
*/
@Length(max = 32, message = "项目id 不能超过32 个字符")
@ExcelAttribute(name = "项目id", maxLength = 32)
@Schema(description = "项目id")
@ExcelProperty("项目id")
private String deptId;
/**
* 项目名称
*/
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@Length(max = 30, message = "项目编码 不能超过30 个字符")
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 费用类型:1管理费2风险金
*/
@Length(max = 1, message = "费用类型:1管理费2风险金 不能超过1 个字符")
@ExcelAttribute(name = "费用类型:1管理费2风险金", maxLength = 1)
@Schema(description = "费用类型:1管理费2风险金")
@ExcelProperty("费用类型:1管理费2风险金")
private String feeType;
/**
* 收费方式:1按比例2金额-人数3金额-人次
*/
@Length(max = 1, message = "收费方式:1按比例2金额-人数3金额-人次 不能超过1 个字符")
@ExcelAttribute(name = "收费方式:1按比例2金额-人数3金额-人次", maxLength = 1)
@Schema(description = "收费方式:1按比例2金额-人数3金额-人次")
@ExcelProperty("收费方式:1按比例2金额-人数3金额-人次")
private String feeMode;
/**
* 收费标准
*/
@Length(max = 10, message = "收费标准 不能超过10 个字符")
@ExcelAttribute(name = "收费标准", maxLength = 10)
@Schema(description = "收费标准")
@ExcelProperty("收费标准")
private String charges;
/**
* 收入来源:1社保2公积金3商险4薪资
*/
@NotBlank(message = "收入来源:1社保2公积金3商险4薪资 不能为空")
@Length(max = 1, message = "收入来源:1社保2公积金3商险4薪资 不能超过1 个字符")
@ExcelAttribute(name = "收入来源:1社保2公积金3商险4薪资", isNotEmpty = true, errorInfo = "收入来源:1社保2公积金3商险4薪资 不能为空", maxLength = 1)
@Schema(description = "收入来源:1社保2公积金3商险4薪资")
@ExcelProperty("收入来源:1社保2公积金3商险4薪资")
private String sourceType;
/**
* 金额
*/
@NotBlank(message = "金额 不能为空")
@ExcelAttribute(name = "金额", isNotEmpty = true, errorInfo = "金额 不能为空")
@Schema(description = "金额")
@ExcelProperty("金额")
private BigDecimal money;
/**
* 生成月份
*/
@Length(max = 6, message = "生成月份 不能超过6 个字符")
@ExcelAttribute(name = "生成月份", maxLength = 6)
@Schema(description = "生成月份")
@ExcelProperty("生成月份")
private String createMonth;
/**
* 缴纳月份
*/
@Length(max = 6, message = "缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "缴纳月份", maxLength = 6)
@Schema(description = "缴纳月份")
@ExcelProperty("缴纳月份")
private String payMonth;
/**
* 数据生成时间
*/
@NotBlank(message = "数据生成时间 不能为空")
@ExcelAttribute(name = "数据生成时间", isNotEmpty = true, errorInfo = "数据生成时间 不能为空", isDate = true)
@Schema(description = "数据生成时间")
@ExcelProperty("数据生成时间")
private Date createTime;
/**
* 数据生成月份
*/
@Length(max = 6, message = "数据生成月份 不能超过6 个字符")
@ExcelAttribute(name = "数据生成月份", maxLength = 6)
@Schema(description = "数据生成月份")
@ExcelProperty("数据生成月份")
private String dataCreateMonth;
/**
* 推送状态:0未推送1已推送
*/
@Length(max = 1, message = "推送状态:0未推送1已推送 不能超过1 个字符")
@ExcelAttribute(name = "推送状态:0未推送1已推送", maxLength = 1)
@Schema(description = "推送状态:0未推送1已推送")
@ExcelProperty("推送状态:0未推送1已推送")
private String pushStatus;
}
/*
* 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.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.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
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 hgw
* @date 2022-08-30 17:34:58
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tincome")
@Tag(name = "收入明细表管理")
public class TIncomeController {
private final TIncomeService tIncomeService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tIncome 收入明细表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TIncome>> getTIncomePage(Page<TIncome> page, TIncomeSearchVo tIncome) {
return new R<>(tIncomeService.getTIncomePage(page, tIncome));
}
/**
* 不分页查询
*
* @param tIncome 收入明细表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('social_tincome_get')" )
public R<List<TIncome>> getTIncomeNoPage(@RequestBody TIncomeSearchVo tIncome) {
return R.ok(tIncomeService.noPageDiy(tIncome));
}
/**
* 通过id查询收入明细表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tincome_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tincome_get')")
public R<TIncome> getById(@PathVariable("id") String id) {
return R.ok(tIncomeService.getById(id));
}
/**
* 新增收入明细表
*
* @param tIncome 收入明细表
* @return R
*/
@Operation(summary = "新增收入明细表", description = "新增收入明细表:hasPermission('social_tincome_add')")
@SysLog("新增收入明细表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tincome_add')")
public R<Boolean> save(@RequestBody TIncome tIncome) {
return R.ok(tIncomeService.save(tIncome));
}
/**
* 修改收入明细表
*
* @param tIncome 收入明细表
* @return R
*/
@Operation(summary = "修改收入明细表", description = "修改收入明细表:hasPermission('social_tincome_edit')")
@SysLog("修改收入明细表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tincome_edit')")
public R<Boolean> updateById(@RequestBody TIncome tIncome) {
return R.ok(tIncomeService.updateById(tIncome));
}
/**
* 通过id删除收入明细表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除收入明细表", description = "通过id删除收入明细表:hasPermission('social_tincome_del')")
@SysLog("通过id删除收入明细表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tincome_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tIncomeService.removeById(id));
}
/**
* 收入明细表 批量导入
*
* @author hgw
* @date 2022-08-30 17:34:58
**/
@SneakyThrows
@Operation(description = "批量新增收入明细表 hasPermission('social_tincome-batch-import')")
@SysLog("批量新增收入明细表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('social_tincome-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tIncomeService.importDiy(file.getInputStream());
}
/**
* 收入明细表 批量导出
*
* @author hgw
* @date 2022-08-30 17:34:58
**/
@Operation(description = "导出收入明细表 hasPermission('social_tincome-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tincome-export')")
public void export(HttpServletResponse response, @RequestBody TIncomeSearchVo searchVo) {
tIncomeService.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.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import org.apache.ibatis.annotations.Mapper;
/**
* 收入明细表-全部明细
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Mapper
public interface TIncomeDetailMapper extends BaseMapper<TIncomeDetail> {
}
/*
* 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.TIncome;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Mapper
public interface TIncomeMapper extends BaseMapper<TIncome> {
/**
* 收入明细表简单分页查询
* @param tIncome 收入明细表
* @return
*/
IPage<TIncome> getTIncomePage(Page<TIncome> page, @Param("tIncome") TIncome tIncome);
}
/*
* 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.TIncomeDetail;
/**
* 收入明细表-全部明细
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
public interface TIncomeDetailService extends IService<TIncomeDetail> {
}
/*
* 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
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.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 收入明细表
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
public interface TIncomeService extends IService<TIncome> {
/**
* 收入明细表简单分页查询
*
* @param tIncome 收入明细表
* @return
*/
IPage<TIncome> getTIncomePage(Page<TIncome> page, TIncomeSearchVo tIncome);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TIncomeSearchVo searchVo);
List<TIncome> noPageDiy(TIncomeSearchVo 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.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeDetailMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 收入明细表-全部明细
*
* @author hgw
* @date 2022-08-30 17:34:58
*/
@Log4j2
@Service
public class TIncomeDetailServiceImpl extends ServiceImpl<TIncomeDetailMapper, TIncomeDetail> implements TIncomeDetailService {
}
/*
* 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 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 com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
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 hgw
* @date 2022-08-30 17:34:58
*/
@Log4j2
@Service
public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> implements TIncomeService {
/**
* 收入明细表简单分页查询
*
* @param tIncome 收入明细表
* @return
*/
@Override
public IPage<TIncome> getTIncomePage(Page<TIncome> page, TIncomeSearchVo tIncome) {
return baseMapper.getTIncomePage(page, tIncome);
}
/**
* 收入明细表批量导出
* @return
*/
@Override
public void listExport(HttpServletResponse response, TIncomeSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TIncome> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TIncome.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<TIncome> util = new ExcelUtil<>(TIncome.class);
for (TIncome 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<TIncome> noPageDiy(TIncomeSearchVo searchVo) {
LambdaQueryWrapper<TIncome> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TIncome::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(TIncomeSearchVo searchVo) {
LambdaQueryWrapper<TIncome> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TIncome::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TIncomeSearchVo entity) {
LambdaQueryWrapper<TIncome> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TIncome::getCreateTime, entity.getCreateTimes()[0])
.le(TIncome::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TIncome::getCreateName, entity.getCreateName());
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TIncomeVo> util1 = new ExcelUtil<>(TIncomeVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TIncomeVo.class, new ReadListener<TIncomeVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TIncomeVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TIncomeVo 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());
importTIncome(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 importTIncome(List<TIncomeVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TIncomeVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TIncomeVo excel) {
TIncome insert = new TIncome();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
<?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.TIncomeDetailMapper">
<resultMap id="tIncomeDetailMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="feeType" column="FEE_TYPE"/>
<result property="feeMode" column="FEE_MODE"/>
<result property="charges" column="CHARGES"/>
<result property="sourceType" column="SOURCE_TYPE"/>
<result property="money" column="MONEY"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="payMonth" column="PAY_MONTH"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="sourceId" column="SOURCE_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_ID,
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_ID,
a.DEPT_NAME,
a.DEPT_NO,
a.FEE_TYPE,
a.FEE_MODE,
a.CHARGES,
a.SOURCE_TYPE,
a.MONEY,
a.CREATE_MONTH,
a.PAY_MONTH,
a.CREATE_TIME,
a.DATA_CREATE_MONTH,
a.SOURCE_ID
</sql>
<sql id="tIncomeDetail_where">
<if test="tIncomeDetail != null">
<if test="tIncomeDetail.id != null and tIncomeDetail.id.trim() != ''">
AND a.ID = #{tIncomeDetail.id}
</if>
<if test="tIncomeDetail.empName != null and tIncomeDetail.empName.trim() != ''">
AND a.EMP_NAME = #{tIncomeDetail.empName}
</if>
<if test="tIncomeDetail.empIdcard != null and tIncomeDetail.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tIncomeDetail.empIdcard}
</if>
<if test="tIncomeDetail.unitId != null and tIncomeDetail.unitId.trim() != ''">
AND a.UNIT_ID = #{tIncomeDetail.unitId}
</if>
<if test="tIncomeDetail.unitName != null and tIncomeDetail.unitName.trim() != ''">
AND a.UNIT_NAME = #{tIncomeDetail.unitName}
</if>
<if test="tIncomeDetail.unitNo != null and tIncomeDetail.unitNo.trim() != ''">
AND a.UNIT_NO = #{tIncomeDetail.unitNo}
</if>
<if test="tIncomeDetail.deptId != null and tIncomeDetail.deptId.trim() != ''">
AND a.DEPT_ID = #{tIncomeDetail.deptId}
</if>
<if test="tIncomeDetail.deptName != null and tIncomeDetail.deptName.trim() != ''">
AND a.DEPT_NAME = #{tIncomeDetail.deptName}
</if>
<if test="tIncomeDetail.deptNo != null and tIncomeDetail.deptNo.trim() != ''">
AND a.DEPT_NO = #{tIncomeDetail.deptNo}
</if>
<if test="tIncomeDetail.feeType != null and tIncomeDetail.feeType.trim() != ''">
AND a.FEE_TYPE = #{tIncomeDetail.feeType}
</if>
<if test="tIncomeDetail.feeMode != null and tIncomeDetail.feeMode.trim() != ''">
AND a.FEE_MODE = #{tIncomeDetail.feeMode}
</if>
<if test="tIncomeDetail.charges != null and tIncomeDetail.charges.trim() != ''">
AND a.CHARGES = #{tIncomeDetail.charges}
</if>
<if test="tIncomeDetail.sourceType != null and tIncomeDetail.sourceType.trim() != ''">
AND a.SOURCE_TYPE = #{tIncomeDetail.sourceType}
</if>
<if test="tIncomeDetail.money != null">
AND a.MONEY = #{tIncomeDetail.money}
</if>
<if test="tIncomeDetail.createMonth != null and tIncomeDetail.createMonth.trim() != ''">
AND a.CREATE_MONTH = #{tIncomeDetail.createMonth}
</if>
<if test="tIncomeDetail.payMonth != null and tIncomeDetail.payMonth.trim() != ''">
AND a.PAY_MONTH = #{tIncomeDetail.payMonth}
</if>
<if test="tIncomeDetail.createTime != null">
AND a.CREATE_TIME = #{tIncomeDetail.createTime}
</if>
<if test="tIncomeDetail.dataCreateMonth != null and tIncomeDetail.dataCreateMonth.trim() != ''">
AND a.DATA_CREATE_MONTH = #{tIncomeDetail.dataCreateMonth}
</if>
<if test="tIncomeDetail.sourceId != null and tIncomeDetail.sourceId.trim() != ''">
AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
</if>
</if>
</sql>
</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.TIncomeMapper">
<resultMap id="tIncomeMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TIncome">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="feeType" column="FEE_TYPE"/>
<result property="feeMode" column="FEE_MODE"/>
<result property="charges" column="CHARGES"/>
<result property="sourceType" column="SOURCE_TYPE"/>
<result property="money" column="MONEY"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="payMonth" column="PAY_MONTH"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="pushStatus" column="PUSH_STATUS"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_ID,
a.UNIT_NAME,
a.UNIT_NO,
a.DEPT_ID,
a.DEPT_NAME,
a.DEPT_NO,
a.FEE_TYPE,
a.FEE_MODE,
a.CHARGES,
a.SOURCE_TYPE,
a.MONEY,
a.CREATE_MONTH,
a.PAY_MONTH,
a.CREATE_TIME,
a.DATA_CREATE_MONTH,
a.PUSH_STATUS
</sql>
<sql id="tIncome_where">
<if test="tIncome != null">
<if test="tIncome.id != null and tIncome.id.trim() != ''">
AND a.ID = #{tIncome.id}
</if>
<if test="tIncome.empName != null and tIncome.empName.trim() != ''">
AND a.EMP_NAME = #{tIncome.empName}
</if>
<if test="tIncome.empIdcard != null and tIncome.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tIncome.empIdcard}
</if>
<if test="tIncome.unitId != null and tIncome.unitId.trim() != ''">
AND a.UNIT_ID = #{tIncome.unitId}
</if>
<if test="tIncome.unitName != null and tIncome.unitName.trim() != ''">
AND a.UNIT_NAME = #{tIncome.unitName}
</if>
<if test="tIncome.unitNo != null and tIncome.unitNo.trim() != ''">
AND a.UNIT_NO = #{tIncome.unitNo}
</if>
<if test="tIncome.deptId != null and tIncome.deptId.trim() != ''">
AND a.DEPT_ID = #{tIncome.deptId}
</if>
<if test="tIncome.deptName != null and tIncome.deptName.trim() != ''">
AND a.DEPT_NAME = #{tIncome.deptName}
</if>
<if test="tIncome.deptNo != null and tIncome.deptNo.trim() != ''">
AND a.DEPT_NO = #{tIncome.deptNo}
</if>
<if test="tIncome.feeType != null and tIncome.feeType.trim() != ''">
AND a.FEE_TYPE = #{tIncome.feeType}
</if>
<if test="tIncome.feeMode != null and tIncome.feeMode.trim() != ''">
AND a.FEE_MODE = #{tIncome.feeMode}
</if>
<if test="tIncome.charges != null and tIncome.charges.trim() != ''">
AND a.CHARGES = #{tIncome.charges}
</if>
<if test="tIncome.sourceType != null and tIncome.sourceType.trim() != ''">
AND a.SOURCE_TYPE = #{tIncome.sourceType}
</if>
<if test="tIncome.money != null">
AND a.MONEY = #{tIncome.money}
</if>
<if test="tIncome.createMonth != null and tIncome.createMonth.trim() != ''">
AND a.CREATE_MONTH = #{tIncome.createMonth}
</if>
<if test="tIncome.payMonth != null and tIncome.payMonth.trim() != ''">
AND a.PAY_MONTH = #{tIncome.payMonth}
</if>
<if test="tIncome.createTime != null">
AND a.CREATE_TIME = #{tIncome.createTime}
</if>
<if test="tIncome.dataCreateMonth != null and tIncome.dataCreateMonth.trim() != ''">
AND a.DATA_CREATE_MONTH = #{tIncome.dataCreateMonth}
</if>
<if test="tIncome.pushStatus != null and tIncome.pushStatus.trim() != ''">
AND a.PUSH_STATUS = #{tIncome.pushStatus}
</if>
</if>
</sql>
<!--tIncome简单分页查询-->
<select id="getTIncomePage" resultMap="tIncomeMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_income a
<where>
1=1
<include refid="tIncome_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