Commit 3804ee0d authored by hongguangwu's avatar hongguangwu

本期申报

parent 80f09c69
......@@ -243,5 +243,22 @@ public class TSalaryAccount2022 {
@ExcelAttribute(name = "累计婴幼儿照护费用")
@ExcelProperty("累计婴幼儿照护费用")
private BigDecimal sumBabyMoney;
/**
* 是否当月新增人员
*/
@ExcelAttribute(name = "是否当月新增人员", readConverterExp = "0=否,1=是")
@ExcelProperty("是否当月新增人员")
private String isNewEmployee;
/**
* 入职年月
*/
@ExcelAttribute(name = "入职年月")
@ExcelProperty("入职年月")
private String createMonth;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
}
......@@ -49,49 +49,18 @@ public class TStatisticsCurrentReport {
/**
* 税务主体(封面抬头)
*/
@ExcelAttribute(name = "税务主体(封面抬头)", maxLength = 50)
@Length(max = 50, message = "税务主体(封面抬头)不能超过50个字符")
@ExcelProperty("税务主体(封面抬头)")
@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;
/**
* 申报月份(YYYYMM)
*/
@ExcelAttribute(name = "申报月份(YYYYMM)", isNotEmpty = true, errorInfo = "申报月份(YYYYMM)不能为空", maxLength = 6)
@ExcelAttribute(name = "申报月份", isNotEmpty = true, errorInfo = "申报月份(YYYYMM)不能为空", maxLength = 6)
@NotBlank(message = "申报月份(YYYYMM)不能为空")
@Length(max = 6, message = "申报月份(YYYYMM)不能超过6个字符")
@ExcelProperty("申报月份(YYYYMM)")
@ExcelProperty("申报月份")
private String declareMonth;
/**
* 员工 ID
*/
@ExcelAttribute(name = "员工 ID", maxLength = 32)
@Length(max = 32, message = "员工 ID不能超过32个字符")
@ExcelProperty("员工 ID")
private String empId;
/**
* 姓名
*/
......@@ -106,12 +75,60 @@ public class TStatisticsCurrentReport {
@Length(max = 25, message = "身份证号不能超过25个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 本期收入
*/
@ExcelAttribute(name = "本期收入")
@ExcelProperty("本期收入")
private BigDecimal realSalary;
/**
* 本期应纳税额
*/
@ExcelAttribute(name = "本期应纳税额")
@ExcelProperty("本期应纳税额")
private BigDecimal salaryTax;
/**
* 本期基本养老保险
*/
@ExcelAttribute(name = "本期基本养老保险")
@ExcelProperty("本期基本养老保险")
private BigDecimal personalPensionMoney;
/**
* 本期基本医疗保险
*/
@ExcelAttribute(name = "本期基本医疗保险")
@ExcelProperty("本期基本医疗保险")
private BigDecimal personalMedicalMoney;
/**
* 本期失业保险
*/
@ExcelAttribute(name = "本期失业保险")
@ExcelProperty("本期失业保险")
private BigDecimal personalUnemploymentMoney;
/**
* 本期住房公积金
*/
@ExcelAttribute(name = "本期住房公积金")
@ExcelProperty("本期住房公积金")
private BigDecimal personalProvidentFee;
/**
* 本期企业年金
*/
@ExcelAttribute(name = "本期企业年金")
@ExcelProperty("本期企业年金")
private BigDecimal enterpriseAnnuity;
/**
* 累计减除费用
*/
@ExcelAttribute(name = "累计减除费用")
@ExcelProperty("累计减除费用")
private BigDecimal costReduction;
/**
* 累计应纳税所得额
*/
@ExcelAttribute(name = "累计应纳税所得额")
@ExcelProperty("累计应纳税所得额")
private BigDecimal taxable;
/**
* 累计子女教育
*/
......@@ -119,17 +136,23 @@ public class TStatisticsCurrentReport {
@ExcelProperty("累计子女教育")
private BigDecimal childEduinfoMoney;
/**
* 累计住房租金
* 累计继续教育
*/
@ExcelAttribute(name = "累计住房租金")
@ExcelProperty("累计住房租金")
private BigDecimal housingRentalinfoMoney;
@ExcelAttribute(name = "累计继续教育")
@ExcelProperty("累计继续教育")
private BigDecimal continuingEducationExpenseMoney;
/**
* 累计住房贷款
*/
@ExcelAttribute(name = "累计住房贷款")
@ExcelProperty("累计住房贷款")
private BigDecimal housingLoanInterestExpenseMoney;
/**
* 累计住房租金
*/
@ExcelAttribute(name = "累计住房租金")
@ExcelProperty("累计住房租金")
private BigDecimal housingRentalinfoMoney;
/**
* 累计赡养老人
*/
......@@ -137,59 +160,69 @@ public class TStatisticsCurrentReport {
@ExcelProperty("累计赡养老人")
private BigDecimal supportElderlyExpenseMoney;
/**
* 累计继续教育
* 累计3岁以下婴幼儿照护
*/
@ExcelAttribute(name = "累计继续教育")
@ExcelProperty("累计继续教育")
private BigDecimal continuingEducationExpenseMoney;
@ExcelAttribute(name = "累计3岁以下婴幼儿照护")
@ExcelProperty("累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney;
/**
* 累计应发
* 是否当月新增人员
*/
@ExcelAttribute(name = "累计应发")
@ExcelProperty("累计应发")
private BigDecimal realSalary;
@ExcelAttribute(name = "是否当月新增人员", readConverterExp = "0=否,1=是")
@ExcelProperty("是否当月新增人员")
private String isNewEmployee;
/**
* 累计基本养老
* 入职年月
*/
@ExcelAttribute(name = "累计基本养老")
@ExcelProperty("累计基本养老")
private BigDecimal personalPensionMoney;
@ExcelAttribute(name = "入职年月")
@ExcelProperty("入职年月")
private String createMonth;
/**
* 累计基本医疗
* 手机号码
*/
@ExcelAttribute(name = "累计基本医疗")
@ExcelProperty("累计基本医疗")
private BigDecimal personalMedicalMoney;
@ExcelAttribute(name = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
// 以下导出不需要
/**
* 累计失业
* 员工 ID
*/
@ExcelAttribute(name = "累计失业")
@ExcelProperty("累计失业")
private BigDecimal personalUnemploymentMoney;
@ExcelAttribute(name = "员工ID", maxLength = 32)
@Length(max = 32, message = "员工 ID不能超过32个字符")
@ExcelProperty("员工ID")
private String empId;
/**
* 个人社保
* 结算部门id
*/
@ExcelAttribute(name = "个人社保")
@ExcelProperty("个人社保")
private BigDecimal personalSocial;
@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 = "累计住房公积金")
@ExcelProperty("累计住房公积金")
private BigDecimal personalProvidentFee;
@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 = "累计企业年金")
@ExcelProperty("累计企业年金")
private BigDecimal enterpriseAnnuity;
@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 = "累计应纳税所得")
@ExcelProperty("累计应纳税所得")
private BigDecimal taxable;
@ExcelAttribute(name = "个人社保")
@ExcelProperty("个人社保")
private BigDecimal personalSocial;
/**
* 税率
*/
......@@ -202,12 +235,7 @@ public class TStatisticsCurrentReport {
@ExcelAttribute(name = "速算扣除")
@ExcelProperty("速算扣除")
private BigDecimal quickDeducation;
/**
* 累计应纳税额
*/
@ExcelAttribute(name = "累计应纳税额")
@ExcelProperty("累计应纳税额")
private BigDecimal salaryTax;
/**
* 单位id
*/
......@@ -235,11 +263,6 @@ public class TStatisticsCurrentReport {
@ExcelAttribute(name = "专项汇总")
@ExcelProperty("专项汇总")
private BigDecimal specialDeduMoney;
/**
* 累计婴幼儿照护费用
*/
@ExcelAttribute(name = "累计婴幼儿照护费用")
@ExcelProperty("累计婴幼儿照护费用")
private BigDecimal sumBabyMoney;
}
......@@ -241,5 +241,22 @@ public class TStatisticsTaxSalary {
@ExcelAttribute(name = "累计婴幼儿照护费用")
@ExcelProperty("累计婴幼儿照护费用")
private BigDecimal sumBabyMoney;
/**
* 是否当月新增人员
*/
@ExcelAttribute(name = "是否当月新增人员", readConverterExp = "0=否,1=是")
@ExcelProperty("是否当月新增人员")
private String isNewEmployee;
/**
* 入职年月
*/
@ExcelAttribute(name = "入职年月")
@ExcelProperty("入职年月")
private String createMonth;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
}
......@@ -16,11 +16,13 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Set;
/**
* 统计-本期申报
......@@ -37,6 +39,10 @@ public class TStatisticsCurrentReportSearchVo extends TStatisticsCurrentReport {
@Schema(description = "选中ID,多个逗号分割")
private String ids;
@TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
/**
* 创建时间区间 [开始时间,结束时间]
*/
......
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
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.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
......@@ -92,6 +93,20 @@ public class TStatisticsCurrentReportController {
tStatisticsCurrentReportService.listExport(response, searchVo);
}
/**
* 通过id删除统计-工资薪金
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除统计-本期申报", description = "通过id删除统计-本期申报:hasPermission('salary_tstatisticscurrentreport_del')")
@SysLog("通过id删除统计-本期申报")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('salary_tstatisticscurrentreport_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tStatisticsCurrentReportService.removeById(id));
}
/**
* @param
* @Description: 生成本期申报
......
......@@ -74,7 +74,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsCurrentReportSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "本期申报批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsCurrentReport> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -85,8 +85,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsCurrentReport.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsCurrentReport.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......@@ -101,7 +100,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("统计-本期申报" + index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("本期申报" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
......@@ -111,7 +110,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("统计-本期申报" + index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("本期申报" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
......
......@@ -56,6 +56,9 @@
<result property="unitNo" column="unit_no"/>
<result property="unitName" column="unit_name"/>
<result property="sumBabyMoney" column="sum_baby_money"/>
<result property="isNewEmployee" column="IS_NEW_EMPLOYEE"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="empPhone" column="EMP_PHONE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -89,7 +92,10 @@
a.unit_id,
a.unit_no,
a.unit_name,
a.sum_baby_money
a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
</sql>
<sql id="tSalaryAccount2022_where">
<if test="tSalaryAccount2022 != null">
......@@ -211,7 +217,7 @@
insert into ${tableName} (
select
a.id,a.INVOICE_TITLE,a.EMP_ID,a.EMP_NAME,a.EMP_IDCARD,
a.SETTLE_DEPART_ID,a.SETTLE_DEPART_NO,a.SETTLE_DEPART_NAME,a.SETTLEMENT_MONTH,a.TAX_MONTH,
a.DEPT_ID SETTLE_DEPART_ID,a.DEPT_NO SETTLE_DEPART_NO,a.DEPT_NAME SETTLE_DEPART_NAME,a.SETTLEMENT_MONTH,a.TAX_MONTH,
ifnull(sum(relaySalary.SALARY_MONEY),0) REAL_SALARY,
ifnull(max(costReduction.SALARY_MONEY),0) cost_reduction,
ifnull(max(specialDeduMoney.SALARY_MONEY),0) SPECIAL_DEDU_MONEY,
......@@ -230,12 +236,14 @@
ifnull(sum(if(annualBonusTax.SALARY_MONEY > 0,annualBonus.SALARY_MONEY,0)),0) annual_bonus,
ifnull(sum(annualBonusTax.SALARY_MONEY),0) annual_bonus_tax,
ifnull(sum(exemptionPersionTax.SALARY_MONEY),0) exemption_persion_tax,
i.id unit_id,i.CUSTOMER_CODE unit_no,i.CUSTOMER_NAME unit_name,
ifnull(max(sumBabyMoney.SALARY_MONEY),0) sum_baby_money
s.unit_id,s.unit_no,s.unit_name,
ifnull(max(sumBabyMoney.SALARY_MONEY),0) sum_baby_money,
if(#{lastMonth} = DATE_FORMAT(e.CREATE_TIME,'%Y%m'),1,0) IS_NEW_EMPLOYEE,
DATE_FORMAT(e.CREATE_TIME,'%Y%m') CREATE_MONTH,
e.EMP_PHONE
from t_salary_account a
left join t_salary_standard s on s.id = a.SALARY_FORM_ID
left join hrms.t_settle_domain d on d.id = a.SETTLE_DEPART_ID
left join hrms.t_customer_info i on i.id = d.CUSTOMER_ID
left join t_salary_employee e on e.id = a.EMP_ID
left join t_salary_account_item relaySalary on relaySalary.SALARY_ACCOUNT_ID = a.id and relaySalary.JAVA_FIED_NAME='relaySalary'
left join t_salary_account_item exemptionPersionTax on exemptionPersionTax.SALARY_ACCOUNT_ID = a.id and exemptionPersionTax.JAVA_FIED_NAME='exemptionPersionTax'
left join t_salary_account_item costReduction on costReduction.SALARY_ACCOUNT_ID = a.id and costReduction.JAVA_FIED_NAME='costReduction'
......@@ -256,8 +264,7 @@
left join t_salary_account_item annualBonusTax on annualBonusTax.SALARY_ACCOUNT_ID = a.id and annualBonusTax.JAVA_FIED_NAME='annualBonusTax'
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME='annualBonus'
where
a.SETTLEMENT_MONTH = #{lastMonth} and a.DELETE_FLAG = 0 and a.SALARY_TYPE != '7' and a.SALARY_TYPE != '3'
and s.DELETE_FLAG = 0
a.SETTLEMENT_MONTH = #{lastMonth} and a.DELETE_FLAG = 0 and a.FORM_TYPE != '7' and a.FORM_TYPE != '3' and s.DELETE_FLAG = 0
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,a.SETTLEMENT_MONTH)
</insert>
......
......@@ -55,6 +55,9 @@
<result property="unitName" column="UNIT_NAME"/>
<result property="specialDeduMoney" column="SPECIAL_DEDU_MONEY"/>
<result property="sumBabyMoney" column="sum_baby_money"/>
<result property="isNewEmployee" column="IS_NEW_EMPLOYEE"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="empPhone" column="EMP_PHONE"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
......@@ -87,7 +90,10 @@
a.UNIT_NO,
a.UNIT_NAME,
a.SPECIAL_DEDU_MONEY,
a.sum_baby_money
a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
</sql>
<sql id="tStatisticsCurrentReport_where">
<if test="tStatisticsCurrentReport != null">
......@@ -231,7 +237,10 @@
s.UNIT_NO,
s.UNIT_NAME,
s.SPECIAL_DEDU_MONEY,
s.sum_baby_money
s.sum_baby_money,
s.IS_NEW_EMPLOYEE,
s.CREATE_MONTH,
s.EMP_PHONE
from t_statistics_tax_salary s
left join
(
......
......@@ -55,6 +55,9 @@
<result property="unitName" column="UNIT_NAME"/>
<result property="specialDeduMoney" column="SPECIAL_DEDU_MONEY"/>
<result property="sumBabyMoney" column="sum_baby_money"/>
<result property="isNewEmployee" column="IS_NEW_EMPLOYEE"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="empPhone" column="EMP_PHONE"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
......@@ -87,7 +90,10 @@
a.UNIT_NO,
a.UNIT_NAME,
a.SPECIAL_DEDU_MONEY,
a.sum_baby_money
a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
</sql>
<sql id="tStatisticsTaxSalary_where">
<if test="tStatisticsTaxSalary != null">
......@@ -207,7 +213,10 @@
,a.REAL_SALARY,a.PERSONAL_PENSION_MONEY,a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY
,a.PERSONAL_SOCIAL,a.PERSONAL_FUND,a.enterprise_annuity,a.taxable,ifnull(c.WITHHOLDING_RATE,0) tax_fee
,ifnull(c.QUICK_DEDUCATION,0) QUICK_DEDUCATION,a.salary_tax,a.unit_id,a.unit_no,a.unit_name,a.SPECIAL_DEDU_MONEY
,a.sum_baby_money
,a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
from (
SELECT
concat(a.id,#{nowMonth}) id,
......@@ -244,7 +253,10 @@
sum(a.enterprise_annuity) enterprise_annuity,
a.unit_id,
a.unit_no,
a.unit_name
a.unit_name,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
FROM ${tableName} a
where a.SETTLEMENT_MONTH <![CDATA[ <= ]]> #{nowMonth} and a.SETTLEMENT_MONTH like concat(#{lastYear},'%')
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE ORDER BY a.settle_depart_id asc
......
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