Commit d302a622 authored by huyuchen's avatar huyuchen

薪资审核页面接口修改

parent d511af90
......@@ -21,62 +21,40 @@ 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 com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
/**
* 统计-申报人员
* 申报对象表
*
* @author hgw
* @date 2022-08-05 11:40:14
* @author huyc
* @date 2022-08-11 10:56:10
*/
@Data
@TableName("t_statistics_tax_declarer")
@Schema(description = "统计-申报人员")
public class TStatisticsTaxDeclarer {
@TableName("t_statistics_declarer")
@EqualsAndHashCode()
@Schema(description = "申报对象表")
public class TStatisticsDeclarer {
/**
* id
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@ExcelProperty("ID")
private String id;
/**
* 税务主体(封面抬头)
*/
@ExcelAttribute(name = "税务主体(封面抬头)", maxLength = 50)
@Length(max = 50, message = "税务主体(封面抬头)不能超过50个字符")
@ExcelProperty("税务主体(封面抬头)")
private String invoiceTitle;
/**
* 结算部门id
*/
@ExcelAttribute(name = "结算部门id", isNotEmpty = true, errorInfo = "结算部门id不能为空", maxLength = 32)
@NotBlank(message = "结算部门id不能为空")
@Length(max = 32, message = "结算部门id不能超过32个字符")
@ExcelProperty("结算部门id")
private String settleDepartId;
/**
* 结算部门no
*/
@ExcelAttribute(name = "结算部门no", isNotEmpty = true, errorInfo = "结算部门no不能为空", maxLength = 50)
@NotBlank(message = "结算部门no不能为空")
@Length(max = 50, message = "结算部门no不能超过50个字符")
@ExcelProperty("结算部门no")
private String settleDepartNo;
/**
* 结算部门name
* 申报单位
*/
@ExcelAttribute(name = "结算部门name", isNotEmpty = true, errorInfo = "结算部门name不能为空", maxLength = 50)
@NotBlank(message = "结算部门name不能为空")
@Length(max = 50, message = "结算部门name不能超过50个字符")
@ExcelProperty("结算部门name")
private String settleDepartName;
@ExcelAttribute(name = "申报单位", maxLength = 50)
@Length(max = 50, message = "申报单位不能超过50个字符")
@ExcelProperty("申报单位")
private String declareUnit;
/**
* 申报月份
*/
......@@ -85,87 +63,61 @@ public class TStatisticsTaxDeclarer {
@Length(max = 6, message = "申报月份不能超过6个字符")
@ExcelProperty("申报月份")
private String declareMonth;
/**
* 员工 ID
*/
@ExcelAttribute(name = "员工 ID", maxLength = 32)
@Length(max = 32, message = "员工 ID不能超过32个字符")
@ExcelProperty("员工 ID")
private String empId;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Length(max = 50, message = "员工姓名不能超过50个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
private String empName;
/**
* 员工身份证号
* 身份证号
*/
@ExcelAttribute(name = "员工身份证号", maxLength = 25)
@Length(max = 25, message = "员工身份证号不能超过25个字符")
@ExcelProperty("员工身份证号")
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Length(max = 20, message = "身份证号不能超过20个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 25)
@Length(max = 25, message = "手机号码不能超过25个字符")
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Length(max = 11, message = "手机号码不能超过11个字符")
@ExcelProperty("手机号码")
private String phone;
/**
* 人员状态(在职/临时/离职)
*/
@ExcelAttribute(name = "人员状态(在职/临时/离职)", maxLength = 5)
@Length(max = 5, message = "人员状态(在职/临时/离职)不能超过5个字符")
@ExcelProperty("人员状态(在职/临时/离职)")
private String userStatus;
/**
* 任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员
*/
@ExcelAttribute(name = "任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员", maxLength = 5)
@Length(max = 5, message = "任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员不能超过5个字符")
@ExcelProperty("任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员")
private String userType;
/**
* 任职受雇从业日期(计税月份)
*/
@ExcelAttribute(name = "任职受雇从业日期(计税月份)", maxLength = 20)
@Length(max = 20, message = "任职受雇从业日期(计税月份)不能超过20个字符")
@ExcelProperty("任职受雇从业日期(计税月份)")
private String taxMonth;
private String empPhone;
/**
* 单位id
* 人员状态
*/
@ExcelAttribute(name = "单位id", maxLength = 32)
@Length(max = 32, message = "单位id不能超过32个字符")
@ExcelProperty("单位id")
private String unitId;
@ExcelAttribute(name = "人员状态", maxLength = 2)
@Length(max = 2, message = "人员状态不能超过2个字符")
@ExcelProperty("人员状态")
private String empStatus;
/**
* 单位no
* 任职受雇从业类型
*/
@ExcelAttribute(name = "单位no", maxLength = 50)
@Length(max = 50, message = "单位no不能超过50个字符")
@ExcelProperty("单位no")
private String unitNo;
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2)
@Length(max = 2, message = "任职受雇从业类型不能超过2个字符")
@ExcelProperty("任职受雇从业类型")
private String occupationType;
/**
* 单位name
* 任职受雇从业日期
*/
@ExcelAttribute(name = "单位name", maxLength = 50)
@Length(max = 50, message = "单位name不能超过50个字符")
@ExcelProperty("单位name")
private String unitName;
@ExcelAttribute(name = "任职受雇从业日期", maxLength = 20)
@Length(max = 20, message = "任职受雇从业日期不能超过20个字符")
@ExcelProperty("任职受雇从业日期")
private String occupationMonth;
/**
* 个税
* 本月是否申报 0 是 1 否
*/
@ExcelAttribute(name = "个税")
@ExcelProperty("个税")
private BigDecimal salaryTax;
@ExcelAttribute(name = "本月是否申报", maxLength = 1)
@Length(max = 1, message = "本月是否申报不能超过1个字符")
@ExcelProperty("本月是否申报")
private String isDeclare;
/**
* 专项总金额
* 不申报原因
*/
@ExcelAttribute(name = "专项总金额")
@ExcelProperty("专项总金额")
private BigDecimal specialDeduMoney;
@ExcelAttribute(name = "不申报原因", maxLength = 200)
@Length(max = 200, message = "不申报原因不能超过200个字符")
@ExcelProperty("不申报原因")
private String undeclareReason;
}
......@@ -16,20 +16,20 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxDeclarer;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 统计-申报人员
* 申报对象表
*
* @author hgw
* @date 2022-08-05 11:40:14
* @author huyc
* @date 2022-08-11 10:56:10
*/
@Data
public class TStatisticsTaxDeclarerSearchVo extends TStatisticsTaxDeclarer {
public class TStatisticsDeclarerSearchVo extends TStatisticsDeclarer {
/**
* 多选导出或删除等操作
......
......@@ -19,70 +19,42 @@ package com.yifu.cloud.plus.v1.yifu.salary.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 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;
/**
* 统计-申报人员
* 申报对象表
*
* @author hgw
* @date 2022-08-05 11:40:14
* @author huyc
* @date 2022-08-11 10:56:10
*/
@Data
public class TStatisticsTaxDeclarerVo extends RowIndex implements Serializable {
public class TStatisticsDeclarerVo extends RowIndex implements Serializable {
/**
* id
* 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")
@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;
/**
* 税务主体(封面抬头)
*/
@Length(max = 50, message = "税务主体(封面抬头) 不能超过50 个字符")
@ExcelAttribute(name = "税务主体(封面抬头)", maxLength = 50)
@Schema(description = "税务主体(封面抬头)")
@ExcelProperty("税务主体(封面抬头)")
private String invoiceTitle;
/**
* 结算部门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 settleDepartId;
/**
* 结算部门no
*/
@NotBlank(message = "结算部门no 不能为空")
@Length(max = 50, message = "结算部门no 不能超过50 个字符")
@ExcelAttribute(name = "结算部门no", isNotEmpty = true, errorInfo = "结算部门no 不能为空", maxLength = 50)
@Schema(description = "结算部门no")
@ExcelProperty("结算部门no")
private String settleDepartNo;
/**
* 结算部门name
* 申报单位
*/
@NotBlank(message = "结算部门name 不能为空")
@Length(max = 50, message = "结算部门name 不能超过50 个字符")
@ExcelAttribute(name = "结算部门name", isNotEmpty = true, errorInfo = "结算部门name 不能为空", maxLength = 50)
@Schema(description = "结算部门name")
@ExcelProperty("结算部门name")
private String settleDepartName;
@Length(max = 50, message = "申报单位 不能超过50 个字符")
@ExcelAttribute(name = "申报单位", maxLength = 50)
@Schema(description = "申报单位")
@ExcelProperty("申报单位")
private String declareUnit;
/**
* 申报月份
*/
......@@ -92,99 +64,69 @@ public class TStatisticsTaxDeclarerVo extends RowIndex implements Serializable {
@Schema(description = "申报月份")
@ExcelProperty("申报月份")
private String declareMonth;
/**
* 员工 ID
*/
@Length(max = 32, message = "员工 ID 不能超过32 个字符")
@ExcelAttribute(name = "员工 ID", maxLength = 32)
@Schema(description = "员工 ID")
@ExcelProperty("员工 ID")
private String empId;
/**
* 员工姓名
*/
@Length(max = 50, message = "员工姓名 不能超过50 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Length(max = 20, message = "员工姓名 不能超过20 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 员工身份证号
* 身份证号
*/
@Length(max = 25, message = "员工身份证号 不能超过25 个字符")
@ExcelAttribute(name = "员工身份证号", maxLength = 25)
@Schema(description = "员工身份证号")
@ExcelProperty("员工身份证号")
@Length(max = 20, message = "身份证号 不能超过20 个字符")
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@Length(max = 25, message = "手机号码 不能超过25 个字符")
@ExcelAttribute(name = "手机号码", maxLength = 25)
@Length(max = 11, message = "手机号码 不能超过11 个字符")
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String phone;
/**
* 人员状态(在职/临时/离职)
*/
@Length(max = 5, message = "人员状态(在职/临时/离职) 不能超过5 个字符")
@ExcelAttribute(name = "人员状态(在职/临时/离职)", maxLength = 5)
@Schema(description = "人员状态(在职/临时/离职)")
@ExcelProperty("人员状态(在职/临时/离职)")
private String userStatus;
/**
* 任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员
*/
@Length(max = 5, message = "任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员 不能超过5 个字符")
@ExcelAttribute(name = "任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员", maxLength = 5)
@Schema(description = "任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员")
@ExcelProperty("任职受雇从业类型(雇员/其他(劳务人员))-目前为雇员")
private String userType;
/**
* 任职受雇从业日期(计税月份)
*/
@Length(max = 20, message = "任职受雇从业日期(计税月份) 不能超过20 个字符")
@ExcelAttribute(name = "任职受雇从业日期(计税月份)", maxLength = 20)
@Schema(description = "任职受雇从业日期(计税月份)")
@ExcelProperty("任职受雇从业日期(计税月份)")
private String taxMonth;
private String empPhone;
/**
* 单位id
* 人员状态
*/
@Length(max = 32, message = "单位id 不能超过32 个字符")
@ExcelAttribute(name = "单位id", maxLength = 32)
@Schema(description = "单位id")
@ExcelProperty("单位id")
private String unitId;
@Length(max = 2, message = "人员状态 不能超过2 个字符")
@ExcelAttribute(name = "人员状态", maxLength = 2)
@Schema(description = "人员状态")
@ExcelProperty("人员状态")
private String empStatus;
/**
* 单位no
* 任职受雇从业类型
*/
@Length(max = 50, message = "单位no 不能超过50 个字符")
@ExcelAttribute(name = "单位no", maxLength = 50)
@Schema(description = "单位no")
@ExcelProperty("单位no")
private String unitNo;
@Length(max = 2, message = "任职受雇从业类型 不能超过2 个字符")
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2)
@Schema(description = "任职受雇从业类型")
@ExcelProperty("任职受雇从业类型")
private String occupationType;
/**
* 单位name
* 任职受雇从业日期
*/
@Length(max = 50, message = "单位name 不能超过50 个字符")
@ExcelAttribute(name = "单位name", maxLength = 50)
@Schema(description = "单位name")
@ExcelProperty("单位name")
private String unitName;
@Length(max = 20, message = "任职受雇从业日期 不能超过20 个字符")
@ExcelAttribute(name = "任职受雇从业日期", maxLength = 20)
@Schema(description = "任职受雇从业日期")
@ExcelProperty("任职受雇从业日期")
private String occupationMonth;
/**
* 个税
* 本月是否申报
*/
@ExcelAttribute(name = "个税")
@Schema(description = "个税")
@ExcelProperty("个税")
private BigDecimal salaryTax;
@Length(max = 1, message = "本月是否申报 不能超过1 个字符")
@ExcelAttribute(name = "本月是否申报", maxLength = 1)
@Schema(description = "本月是否申报")
@ExcelProperty("本月是否申报")
private String isDeclare;
/**
* 专项总金额
* 不申报原因
*/
@ExcelAttribute(name = "专项总金额")
@Schema(description = "专项总金额")
@ExcelProperty("专项总金额")
private BigDecimal specialDeduMoney;
@Length(max = 200, message = "不申报原因 不能超过200 个字符")
@ExcelAttribute(name = "不申报原因", maxLength = 200)
@Schema(description = "不申报原因")
@ExcelProperty("不申报原因")
private String undeclareReason;
}
/*
* 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.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.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsDeclarerService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* 申报对象表
*
* @author huyc
* @date 2022-08-11 10:56:10
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tstatisticsdeclarer" )
@Tag(name = "申报对象表管理")
public class TStatisticsDeclarerController {
private final TStatisticsDeclarerService tStatisticsDeclarerService;
/**
* 简单分页查询
* @param page 分页对象
* @param tStatisticsDeclarer 申报对象表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TStatisticsDeclarer>> getTStatisticsDeclarerPage(Page<TStatisticsDeclarer> page, TStatisticsDeclarerSearchVo tStatisticsDeclarer) {
return new R<>(tStatisticsDeclarerService.getTStatisticsDeclarerPage(page,tStatisticsDeclarer));
}
/**
* 不分页查询
* @param tStatisticsDeclarer 申报对象表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage" )
public R<List<TStatisticsDeclarer>> getTStatisticsDeclarerNoPage(@RequestBody TStatisticsDeclarerSearchVo tStatisticsDeclarer) {
return R.ok(tStatisticsDeclarerService.noPageDiy(tStatisticsDeclarer));
}
/**
* 通过id查询申报对象表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticsdeclarer_get')")
@GetMapping("/{id}" )
public R<TStatisticsDeclarer> getById(@PathVariable("id" ) String id) {
return R.ok(tStatisticsDeclarerService.getById(id));
}
/**
* 新增申报对象表
* @param tStatisticsDeclarer 申报对象表
* @return R
*/
@Operation(summary = "新增申报对象表", description = "新增申报对象表:hasPermission('salary_tstatisticsdeclarer_add')")
@SysLog("新增申报对象表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer_add')" )
public R<Boolean> save(@RequestBody TStatisticsDeclarer tStatisticsDeclarer) {
return R.ok(tStatisticsDeclarerService.save(tStatisticsDeclarer));
}
/**
* 修改申报对象表
* @param tStatisticsDeclarer 申报对象表
* @return R
*/
@Operation(summary = "修改申报对象表", description = "修改申报对象表:hasPermission('salary_tstatisticsdeclarer_edit')")
@SysLog("修改申报对象表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer_edit')" )
public R<Boolean> updateById(@RequestBody TStatisticsDeclarer tStatisticsDeclarer) {
return R.ok(tStatisticsDeclarerService.updateById(tStatisticsDeclarer));
}
/**
* 通过id删除申报对象表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除申报对象表", description = "通过id删除申报对象表:hasPermission('salary_tstatisticsdeclarer_del')")
@SysLog("通过id删除申报对象表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tStatisticsDeclarerService.removeById(id));
}
/**
* 申报对象表 批量导入
*
* @author huyc
* @date 2022-08-11 10:56:10
**/
@SneakyThrows
@Operation(description = "批量新增申报对象表 hasPermission('salary_tstatisticsdeclarer-batch-import')")
@SysLog("批量新增申报对象表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) throws IOException {
return tStatisticsDeclarerService.importDiy(file.getInputStream());
}
/**
* 申报对象表 批量导出
* @author huyc
* @date 2022-08-11 10:56:10
**/
@Operation(description = "导出申报对象表 hasPermission('salary_tstatisticsdeclarer-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-export')")
public void export(HttpServletResponse response, @RequestBody TStatisticsDeclarerSearchVo searchVo) {
tStatisticsDeclarerService.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.salary.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.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxDeclarerService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxDeclarerSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* 统计-申报人员
*
* @author hgw
* @date 2022-08-05 11:40:14
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tstatisticstaxdeclarer")
@Tag(name = "统计-申报人员管理")
public class TStatisticsTaxDeclarerController {
private final TStatisticsTaxDeclarerService tStatisticsTaxDeclarerService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tStatisticsTaxDeclarer 统计-申报人员
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TStatisticsTaxDeclarer>> getTStatisticsTaxDeclarerPage(Page<TStatisticsTaxDeclarer> page, TStatisticsTaxDeclarerSearchVo tStatisticsTaxDeclarer) {
return new R<>(tStatisticsTaxDeclarerService.getTStatisticsTaxDeclarerPage(page, tStatisticsTaxDeclarer));
}
/**
* 通过id查询统计-申报人员
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticstaxdeclarer_get')")
@GetMapping("/{id}")
public R<TStatisticsTaxDeclarer> getById(@PathVariable("id") String id) {
return R.ok(tStatisticsTaxDeclarerService.getById(id));
}
/**
* 通过id删除统计-申报人员
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除统计-申报人员", description = "通过id删除统计-申报人员:hasPermission('salary_tstatisticstaxdeclarer_del')")
@SysLog("通过id删除统计-申报人员")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('salary_tstatisticstaxdeclarer_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tStatisticsTaxDeclarerService.removeById(id));
}
/**
* 统计-申报人员 批量导出
*
* @author hgw
* @date 2022-08-05 11:40:14
**/
@Operation(description = "导出统计-申报人员 hasPermission('salary_tstatisticstaxdeclarer-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('salary_tstatisticstaxdeclarer-export')")
public void export(HttpServletResponse response, @RequestBody TStatisticsTaxDeclarerSearchVo searchVo) {
tStatisticsTaxDeclarerService.listExport(response, searchVo);
}
}
......@@ -18,23 +18,24 @@
package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxDeclarer;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 统计-申报人员
* 申报对象表
*
* @author hgw
* @date 2022-08-05 11:40:14
* @author huyc
* @date 2022-08-11 10:56:10
*/
@Mapper
public interface TStatisticsTaxDeclarerMapper extends BaseMapper<TStatisticsTaxDeclarer> {
public interface TStatisticsDeclarerMapper extends BaseMapper<TStatisticsDeclarer> {
/**
* 统计-申报人员简单分页查询
* @param tStatisticsTaxDeclarer 统计-申报人员
* 申报对象表简单分页查询
* @param tStatisticsDeclarer 申报对象表
* @return
*/
IPage<TStatisticsTaxDeclarer> getTStatisticsTaxDeclarerPage(Page<TStatisticsTaxDeclarer> page, @Param("tStatisticsTaxDeclarer") TStatisticsTaxDeclarer tStatisticsTaxDeclarer);
IPage<TStatisticsDeclarer> getTStatisticsDeclarerPage(Page<TStatisticsDeclarer> page, @Param("tStatisticsDeclarer") TStatisticsDeclarer tStatisticsDeclarer);
}
......@@ -17,35 +17,34 @@
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
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.salary.entity.TStatisticsTaxDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxDeclarerSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 统计-申报人员
* 申报对象表
*
* @author hgw
* @date 2022-08-05 11:40:14
* @author huyc
* @date 2022-08-11 10:56:10
*/
public interface TStatisticsTaxDeclarerService extends IService<TStatisticsTaxDeclarer> {
public interface TStatisticsDeclarerService extends IService<TStatisticsDeclarer> {
/**
* 统计-申报人员简单分页查询
* @param tStatisticsTaxDeclarer 统计-申报人员
* 申报对象表简单分页查询
* @param tStatisticsDeclarer 申报对象表
* @return
*/
IPage<TStatisticsTaxDeclarer> getTStatisticsTaxDeclarerPage(Page<TStatisticsTaxDeclarer> page, TStatisticsTaxDeclarerSearchVo tStatisticsTaxDeclarer);
IPage<TStatisticsDeclarer> getTStatisticsDeclarerPage(Page<TStatisticsDeclarer> page, TStatisticsDeclarerSearchVo tStatisticsDeclarer);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TStatisticsTaxDeclarerSearchVo searchVo);
void listExport(HttpServletResponse response, TStatisticsDeclarerSearchVo searchVo);
List<TStatisticsTaxDeclarer> noPageDiy(TStatisticsTaxDeclarerSearchVo searchVo);
List<TStatisticsDeclarer> noPageDiy(TStatisticsDeclarerSearchVo 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.salary.service.impl;
import cn.hutool.core.bean.BeanUtil;
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.salary.entity.TStatisticsTaxDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsTaxDeclarerMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsTaxDeclarerService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxDeclarerSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsTaxDeclarerVo;
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-05 11:40:14
*/
@Log4j2
@Service
public class TStatisticsTaxDeclarerServiceImpl extends ServiceImpl<TStatisticsTaxDeclarerMapper, TStatisticsTaxDeclarer> implements TStatisticsTaxDeclarerService {
/**
* 统计-申报人员简单分页查询
*
* @param tStatisticsTaxDeclarer 统计-申报人员
* @return
*/
@Override
public IPage<TStatisticsTaxDeclarer> getTStatisticsTaxDeclarerPage(Page<TStatisticsTaxDeclarer> page, TStatisticsTaxDeclarerSearchVo tStatisticsTaxDeclarer) {
return baseMapper.getTStatisticsTaxDeclarerPage(page, tStatisticsTaxDeclarer);
}
/**
* 统计-申报人员批量导出
*
* @return
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsTaxDeclarerSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsTaxDeclarer> 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, TStatisticsTaxDeclarer.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<TStatisticsTaxDeclarer> util = new ExcelUtil<>(TStatisticsTaxDeclarer.class);
for (TStatisticsTaxDeclarer 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<TStatisticsTaxDeclarer> noPageDiy(TStatisticsTaxDeclarerSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsTaxDeclarer> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TStatisticsTaxDeclarer::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TStatisticsTaxDeclarerSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsTaxDeclarer> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TStatisticsTaxDeclarer::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TStatisticsTaxDeclarerSearchVo entity) {
LambdaQueryWrapper<TStatisticsTaxDeclarer> wrapper = Wrappers.lambdaQuery();
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TStatisticsTaxDeclarerVo> util1 = new ExcelUtil<>(TStatisticsTaxDeclarerVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TStatisticsTaxDeclarerVo.class, new ReadListener<TStatisticsTaxDeclarerVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TStatisticsTaxDeclarerVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TStatisticsTaxDeclarerVo 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());
importTStatisticsTaxDeclarer(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 importTStatisticsTaxDeclarer(List<TStatisticsTaxDeclarerVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TStatisticsTaxDeclarerVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TStatisticsTaxDeclarerVo excel) {
TStatisticsTaxDeclarer insert = new TStatisticsTaxDeclarer();
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.salary.mapper.TStatisticsDeclarerMapper">
<resultMap id="tStatisticsDeclarerMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer">
<id property="id" column="ID"/>
<result property="declareUnit" column="DECLARE_UNIT"/>
<result property="declareMonth" column="DECLARE_MONTH"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="empStatus" column="EMP_STATUS"/>
<result property="occupationType" column="OCCUPATION_TYPE"/>
<result property="occupationMonth" column="OCCUPATION_MONTH"/>
<result property="isDeclare" column="IS_DECLARE"/>
<result property="undeclareReason" column="UNDECLARE_REASON"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.DECLARE_UNIT,
a.DECLARE_MONTH,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_PHONE,
a.EMP_STATUS,
a.OCCUPATION_TYPE,
a.OCCUPATION_MONTH,
a.IS_DECLARE,
a.UNDECLARE_REASON
</sql>
<sql id="tStatisticsDeclarer_where">
<if test="tStatisticsDeclarer != null">
<if test="tStatisticsDeclarer.id != null and tStatisticsDeclarer.id.trim() != ''">
AND a.ID = #{tStatisticsDeclarer.id}
</if>
<if test="tStatisticsDeclarer.declareUnit != null and tStatisticsDeclarer.declareUnit.trim() != ''">
AND a.DECLARE_UNIT like concat(#{tStatisticsDeclarer.declareUnit},'%')
</if>
<if test="tStatisticsDeclarer.declareMonth != null and tStatisticsDeclarer.declareMonth.trim() != ''">
AND a.DECLARE_MONTH = #{tStatisticsDeclarer.declareMonth}
</if>
<if test="tStatisticsDeclarer.empName != null and tStatisticsDeclarer.empName.trim() != ''">
AND a.EMP_NAME = #{tStatisticsDeclarer.empName}
</if>
<if test="tStatisticsDeclarer.empIdcard != null and tStatisticsDeclarer.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tStatisticsDeclarer.empIdcard}
</if>
<if test="tStatisticsDeclarer.empPhone != null and tStatisticsDeclarer.empPhone.trim() != ''">
AND a.EMP_PHONE = #{tStatisticsDeclarer.empPhone}
</if>
<if test="tStatisticsDeclarer.empStatus != null and tStatisticsDeclarer.empStatus.trim() != ''">
AND a.EMP_STATUS = #{tStatisticsDeclarer.empStatus}
</if>
<if test="tStatisticsDeclarer.occupationType != null and tStatisticsDeclarer.occupationType.trim() != ''">
AND a.OCCUPATION_TYPE = #{tStatisticsDeclarer.occupationType}
</if>
<if test="tStatisticsDeclarer.occupationMonth != null and tStatisticsDeclarer.occupationMonth.trim() != ''">
AND a.OCCUPATION_MONTH = #{tStatisticsDeclarer.occupationMonth}
</if>
<if test="tStatisticsDeclarer.isDeclare != null and tStatisticsDeclarer.isDeclare.trim() != ''">
AND a.IS_DECLARE = #{tStatisticsDeclarer.isDeclare}
</if>
<if test="tStatisticsDeclarer.undeclareReason != null and tStatisticsDeclarer.undeclareReason.trim() != ''">
AND a.UNDECLARE_REASON = #{tStatisticsDeclarer.undeclareReason}
</if>
</if>
</sql>
<!--tStatisticsDeclarer简单分页查询-->
<select id="getTStatisticsDeclarerPage" resultMap="tStatisticsDeclarerMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_statistics_declarer a
<where>
1=1
<include refid="tStatisticsDeclarer_where"/>
</where>
order by a.DECLARE_MONTH desc
</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.salary.mapper.TStatisticsTaxDeclarerMapper">
<resultMap id="tStatisticsTaxDeclarerMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsTaxDeclarer">
<id property="id" column="id"/>
<result property="invoiceTitle" column="INVOICE_TITLE"/>
<result property="settleDepartId" column="SETTLE_DEPART_ID"/>
<result property="settleDepartNo" column="SETTLE_DEPART_NO"/>
<result property="settleDepartName" column="SETTLE_DEPART_NAME"/>
<result property="declareMonth" column="DECLARE_MONTH"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="phone" column="PHONE"/>
<result property="userStatus" column="user_status"/>
<result property="userType" column="user_type"/>
<result property="taxMonth" column="tax_month"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="salaryTax" column="salary_tax"/>
<result property="specialDeduMoney" column="special_dedu_money"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.INVOICE_TITLE,
a.SETTLE_DEPART_ID,
a.SETTLE_DEPART_NO,
a.SETTLE_DEPART_NAME,
a.DECLARE_MONTH,
a.EMP_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.PHONE,
a.user_status,
a.user_type,
a.tax_month,
a.UNIT_ID,
a.UNIT_NO,
a.UNIT_NAME,
a.salary_tax,
a.special_dedu_money
</sql>
<sql id="tStatisticsTaxDeclarer_where">
<if test="tStatisticsTaxDeclarer != null">
<if test="tStatisticsTaxDeclarer.id != null and tStatisticsTaxDeclarer.id.trim() != ''">
AND a.id = #{tStatisticsTaxDeclarer.id}
</if>
<if test="tStatisticsTaxDeclarer.invoiceTitle != null and tStatisticsTaxDeclarer.invoiceTitle.trim() != ''">
AND a.INVOICE_TITLE = #{tStatisticsTaxDeclarer.invoiceTitle}
</if>
<if test="tStatisticsTaxDeclarer.settleDepartId != null and tStatisticsTaxDeclarer.settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{tStatisticsTaxDeclarer.settleDepartId}
</if>
<if test="tStatisticsTaxDeclarer.settleDepartNo != null and tStatisticsTaxDeclarer.settleDepartNo.trim() != ''">
AND a.SETTLE_DEPART_NO = #{tStatisticsTaxDeclarer.settleDepartNo}
</if>
<if test="tStatisticsTaxDeclarer.settleDepartName != null and tStatisticsTaxDeclarer.settleDepartName.trim() != ''">
AND a.SETTLE_DEPART_NAME = #{tStatisticsTaxDeclarer.settleDepartName}
</if>
<if test="tStatisticsTaxDeclarer.declareMonth != null and tStatisticsTaxDeclarer.declareMonth.trim() != ''">
AND a.DECLARE_MONTH = #{tStatisticsTaxDeclarer.declareMonth}
</if>
<if test="tStatisticsTaxDeclarer.empId != null and tStatisticsTaxDeclarer.empId.trim() != ''">
AND a.EMP_ID = #{tStatisticsTaxDeclarer.empId}
</if>
<if test="tStatisticsTaxDeclarer.empName != null and tStatisticsTaxDeclarer.empName.trim() != ''">
AND a.EMP_NAME = #{tStatisticsTaxDeclarer.empName}
</if>
<if test="tStatisticsTaxDeclarer.empIdcard != null and tStatisticsTaxDeclarer.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tStatisticsTaxDeclarer.empIdcard}
</if>
<if test="tStatisticsTaxDeclarer.phone != null and tStatisticsTaxDeclarer.phone.trim() != ''">
AND a.PHONE = #{tStatisticsTaxDeclarer.phone}
</if>
<if test="tStatisticsTaxDeclarer.userStatus != null and tStatisticsTaxDeclarer.userStatus.trim() != ''">
AND a.user_status = #{tStatisticsTaxDeclarer.userStatus}
</if>
<if test="tStatisticsTaxDeclarer.userType != null and tStatisticsTaxDeclarer.userType.trim() != ''">
AND a.user_type = #{tStatisticsTaxDeclarer.userType}
</if>
<if test="tStatisticsTaxDeclarer.taxMonth != null and tStatisticsTaxDeclarer.taxMonth.trim() != ''">
AND a.tax_month = #{tStatisticsTaxDeclarer.taxMonth}
</if>
<if test="tStatisticsTaxDeclarer.unitId != null and tStatisticsTaxDeclarer.unitId.trim() != ''">
AND a.UNIT_ID = #{tStatisticsTaxDeclarer.unitId}
</if>
<if test="tStatisticsTaxDeclarer.unitNo != null and tStatisticsTaxDeclarer.unitNo.trim() != ''">
AND a.UNIT_NO = #{tStatisticsTaxDeclarer.unitNo}
</if>
<if test="tStatisticsTaxDeclarer.unitName != null and tStatisticsTaxDeclarer.unitName.trim() != ''">
AND a.UNIT_NAME = #{tStatisticsTaxDeclarer.unitName}
</if>
<if test="tStatisticsTaxDeclarer.salaryTax != null">
AND a.salary_tax = #{tStatisticsTaxDeclarer.salaryTax}
</if>
<if test="tStatisticsTaxDeclarer.specialDeduMoney != null">
AND a.special_dedu_money = #{tStatisticsTaxDeclarer.specialDeduMoney}
</if>
</if>
</sql>
<!--tStatisticsTaxDeclarer简单分页查询-->
<select id="getTStatisticsTaxDeclarerPage" resultMap="tStatisticsTaxDeclarerMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_statistics_tax_declarer a
<where>
1=1
<include refid="tStatisticsTaxDeclarer_where"/>
</where>
</select>
</mapper>
......@@ -132,14 +132,14 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
/**
* 个人缴费额
*/
@ExcelAttribute(name = "个人缴费额", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "个人缴费额", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "个人缴费额")
@ExcelProperty("个人缴费额")
private BigDecimal personalMoney;
/**
* 单位缴费额
*/
@ExcelAttribute(name = "单位缴费额", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "单位缴费额", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "单位缴费额")
@ExcelProperty("单位缴费额")
private BigDecimal unitMoney;
......@@ -154,14 +154,14 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
/**
* 医保单位缴费
*/
@ExcelAttribute(name = "医保单位缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "医保单位缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "医保单位缴费")
@ExcelProperty("医保单位缴费")
private BigDecimal unitMedicalMoney;
/**
* 医保个人缴费
*/
@ExcelAttribute(name = "医保个人缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "医保个人缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "医保个人缴费")
@ExcelProperty("医保个人缴费")
private BigDecimal personalMedicalMoney;
......@@ -169,7 +169,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
/**
* 单位医疗救助金 (对应单位大病)
*/
@ExcelAttribute(name = "单位医疗救助金", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "单位医疗救助金", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "单位医疗救助金")
@ExcelProperty("单位医疗救助金")
private BigDecimal unitBigailmentMoney;
......@@ -177,7 +177,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
/**
* 个人医疗救助金 (对应个人大病)
*/
@ExcelAttribute(name = "个人医疗救助金", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "个人医疗救助金", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description = "个人医疗救助金")
@ExcelProperty("个人医疗救助金")
private BigDecimal personalBigailmentMoney;
......
......@@ -330,14 +330,14 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
/**
* 单位补缴利息
*/
@ExcelAttribute(name = "单位补缴利息", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "单位补缴利息", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="单位补缴利息")
@ExcelProperty("单位补缴利息")
private BigDecimal companyAccrual;
/**
* 个人补缴利息
*/
@ExcelAttribute(name = "个人补缴利息", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "个人补缴利息", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="个人补缴利息")
@ExcelProperty("个人补缴利息")
private BigDecimal personalAccrual;
......@@ -449,70 +449,70 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
/**
* 养老单位缴费
*/
@ExcelAttribute(name = "养老单位缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "养老单位缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="养老单位缴费")
@ExcelProperty("养老单位缴费")
private BigDecimal unitPensionMoney;
/**
* 医保单位缴费
*/
@ExcelAttribute(name = "医保单位缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "医保单位缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="医保单位缴费")
@ExcelProperty("医保单位缴费")
private BigDecimal unitMedicalMoney;
/**
* 失业单位缴费
*/
@ExcelAttribute(name = "失业单位缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "失业单位缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="失业单位缴费")
@ExcelProperty("失业单位缴费")
private BigDecimal unitUnemploymentMoney;
/**
* 工伤缴费
*/
@ExcelAttribute(name = "工伤缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "工伤缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="工伤缴费")
@ExcelProperty("工伤缴费")
private BigDecimal unitInjuryMoney;
/**
* 生育缴费
*/
@ExcelAttribute(name = "生育缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "生育缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="生育缴费")
@ExcelProperty("生育缴费")
private BigDecimal unitBirthMoney;
/**
* 单位医疗救助金
*/
@ExcelAttribute(name = "单位医疗救助金", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "单位医疗救助金", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="单位医疗救助金")
@ExcelProperty("单位医疗救助金")
private BigDecimal unitBigmailmentMoney;
/**
* 养老个人缴费
*/
@ExcelAttribute(name = "养老个人缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "养老个人缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="养老个人缴费")
@ExcelProperty("养老个人缴费")
private BigDecimal personalPensionMoney;
/**
* 医保个人缴费
*/
@ExcelAttribute(name = "医保个人缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "医保个人缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="医保个人缴费")
@ExcelProperty("医保个人缴费")
private BigDecimal personalMedicalMoney;
/**
* 失业个人缴费
*/
@ExcelAttribute(name = "失业个人缴费", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "失业个人缴费", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="失业个人缴费")
@ExcelProperty("失业个人缴费")
private BigDecimal personalUnemploymentMoney;
/**
* 个人医疗救助金
*/
@ExcelAttribute(name = "个人医疗救助金", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "个人医疗救助金", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="个人医疗救助金")
@ExcelProperty("个人医疗救助金")
private BigDecimal personalBigmailmentMoney;
......@@ -541,7 +541,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
/**
* 公积金单边金额
*/
@ExcelAttribute(name = "公积金单边金额", isFloat = true,max = "999999999.99")
@ExcelAttribute(name = "公积金单边金额", isFloat = true,max = "999999999.99", min= -999999999)
@Schema(description ="公积金单边金额")
@ExcelProperty("公积金单边金额")
private BigDecimal unitProvidentSum;
......
......@@ -144,7 +144,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
;
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......
......@@ -915,9 +915,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
private List<TPreDispatchInfo> changePreRes(List<TPreDispatchReduceVo> list) {
List<TPreDispatchInfo> listInfo = new ArrayList<>();
TPreDispatchInfo preInfo = new TPreDispatchInfo();
if (Common.isNotNull(list)){
for (TPreDispatchReduceVo info:list){
TPreDispatchInfo preInfo = new TPreDispatchInfo();
BeanUtils.copyProperties(info,preInfo);
listInfo.add(preInfo);
}
......
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