Commit 20fb54ca authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 76fe946e 478b21f8
...@@ -243,5 +243,22 @@ public class TSalaryAccount2022 { ...@@ -243,5 +243,22 @@ public class TSalaryAccount2022 {
@ExcelAttribute(name = "累计婴幼儿照护费用") @ExcelAttribute(name = "累计婴幼儿照护费用")
@ExcelProperty("累计婴幼儿照护费用") @ExcelProperty("累计婴幼儿照护费用")
private BigDecimal sumBabyMoney; 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 { ...@@ -49,49 +49,18 @@ public class TStatisticsCurrentReport {
/** /**
* 税务主体(封面抬头) * 税务主体(封面抬头)
*/ */
@ExcelAttribute(name = "税务主体(封面抬头)", maxLength = 50) @ExcelAttribute(name = "申报单位", maxLength = 50)
@Length(max = 50, message = "税务主体(封面抬头)不能超过50个字符") @Length(max = 50, message = "申报单位不能超过50个字符")
@ExcelProperty("税务主体(封面抬头)") @ExcelProperty("申报单位")
private String invoiceTitle; 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) * 申报月份(YYYYMM)
*/ */
@ExcelAttribute(name = "申报月份(YYYYMM)", isNotEmpty = true, errorInfo = "申报月份(YYYYMM)不能为空", maxLength = 6) @ExcelAttribute(name = "申报月份", isNotEmpty = true, errorInfo = "申报月份(YYYYMM)不能为空", maxLength = 6)
@NotBlank(message = "申报月份(YYYYMM)不能为空") @NotBlank(message = "申报月份(YYYYMM)不能为空")
@Length(max = 6, message = "申报月份(YYYYMM)不能超过6个字符") @Length(max = 6, message = "申报月份(YYYYMM)不能超过6个字符")
@ExcelProperty("申报月份(YYYYMM)") @ExcelProperty("申报月份")
private String declareMonth; 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 { ...@@ -106,12 +75,60 @@ public class TStatisticsCurrentReport {
@Length(max = 25, message = "身份证号不能超过25个字符") @Length(max = 25, message = "身份证号不能超过25个字符")
@ExcelProperty("身份证号") @ExcelProperty("身份证号")
private String empIdcard; 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 = "累计减除费用") @ExcelAttribute(name = "累计减除费用")
@ExcelProperty("累计减除费用") @ExcelProperty("累计减除费用")
private BigDecimal costReduction; private BigDecimal costReduction;
/**
* 累计应纳税所得额
*/
@ExcelAttribute(name = "累计应纳税所得额")
@ExcelProperty("累计应纳税所得额")
private BigDecimal taxable;
/** /**
* 累计子女教育 * 累计子女教育
*/ */
...@@ -119,17 +136,23 @@ public class TStatisticsCurrentReport { ...@@ -119,17 +136,23 @@ public class TStatisticsCurrentReport {
@ExcelProperty("累计子女教育") @ExcelProperty("累计子女教育")
private BigDecimal childEduinfoMoney; private BigDecimal childEduinfoMoney;
/** /**
* 累计住房租金 * 累计继续教育
*/ */
@ExcelAttribute(name = "累计住房租金") @ExcelAttribute(name = "累计继续教育")
@ExcelProperty("累计住房租金") @ExcelProperty("累计继续教育")
private BigDecimal housingRentalinfoMoney; private BigDecimal continuingEducationExpenseMoney;
/** /**
* 累计住房贷款 * 累计住房贷款
*/ */
@ExcelAttribute(name = "累计住房贷款") @ExcelAttribute(name = "累计住房贷款")
@ExcelProperty("累计住房贷款") @ExcelProperty("累计住房贷款")
private BigDecimal housingLoanInterestExpenseMoney; private BigDecimal housingLoanInterestExpenseMoney;
/**
* 累计住房租金
*/
@ExcelAttribute(name = "累计住房租金")
@ExcelProperty("累计住房租金")
private BigDecimal housingRentalinfoMoney;
/** /**
* 累计赡养老人 * 累计赡养老人
*/ */
...@@ -137,59 +160,69 @@ public class TStatisticsCurrentReport { ...@@ -137,59 +160,69 @@ public class TStatisticsCurrentReport {
@ExcelProperty("累计赡养老人") @ExcelProperty("累计赡养老人")
private BigDecimal supportElderlyExpenseMoney; private BigDecimal supportElderlyExpenseMoney;
/** /**
* 累计继续教育 * 累计3岁以下婴幼儿照护
*/ */
@ExcelAttribute(name = "累计继续教育") @ExcelAttribute(name = "累计3岁以下婴幼儿照护")
@ExcelProperty("累计继续教育") @ExcelProperty("累计3岁以下婴幼儿照护")
private BigDecimal continuingEducationExpenseMoney; private BigDecimal sumBabyMoney;
/** /**
* 累计应发 * 是否当月新增人员
*/ */
@ExcelAttribute(name = "累计应发") @ExcelAttribute(name = "是否当月新增人员", readConverterExp = "0=否,1=是")
@ExcelProperty("累计应发") @ExcelProperty("是否当月新增人员")
private BigDecimal realSalary; private String isNewEmployee;
/** /**
* 累计基本养老 * 入职年月
*/ */
@ExcelAttribute(name = "累计基本养老") @ExcelAttribute(name = "入职年月")
@ExcelProperty("累计基本养老") @ExcelProperty("入职年月")
private BigDecimal personalPensionMoney; private String createMonth;
/** /**
* 累计基本医疗 * 手机号码
*/ */
@ExcelAttribute(name = "累计基本医疗") @ExcelAttribute(name = "手机号码")
@ExcelProperty("累计基本医疗") @ExcelProperty("手机号码")
private BigDecimal personalMedicalMoney; private String empPhone;
// 以下导出不需要
/** /**
* 累计失业 * 员工 ID
*/ */
@ExcelAttribute(name = "累计失业") @ExcelAttribute(name = "员工ID", maxLength = 32)
@ExcelProperty("累计失业") @Length(max = 32, message = "员工 ID不能超过32个字符")
private BigDecimal personalUnemploymentMoney; @ExcelProperty("员工ID")
private String empId;
/** /**
* 个人社保 * 结算部门id
*/ */
@ExcelAttribute(name = "个人社保") @ExcelAttribute(name = "结算部门id", isNotEmpty = true, errorInfo = "结算部门id不能为空", maxLength = 32)
@ExcelProperty("个人社保") @NotBlank(message = "结算部门id不能为空")
private BigDecimal personalSocial; @Length(max = 32, message = "结算部门id不能超过32个字符")
@ExcelProperty("结算部门id")
private String settleDepartId;
/** /**
* 累计住房公积金 * 结算部门no
*/ */
@ExcelAttribute(name = "累计住房公积金") @ExcelAttribute(name = "结算部门no", isNotEmpty = true, errorInfo = "结算部门no不能为空", maxLength = 50)
@ExcelProperty("累计住房公积金") @NotBlank(message = "结算部门no不能为空")
private BigDecimal personalProvidentFee; @Length(max = 50, message = "结算部门no不能超过50个字符")
@ExcelProperty("结算部门no")
private String settleDepartNo;
/** /**
* 累计企业年金 * 结算部门name
*/ */
@ExcelAttribute(name = "累计企业年金") @ExcelAttribute(name = "结算部门name", isNotEmpty = true, errorInfo = "结算部门name不能为空", maxLength = 50)
@ExcelProperty("累计企业年金") @NotBlank(message = "结算部门name不能为空")
private BigDecimal enterpriseAnnuity; @Length(max = 50, message = "结算部门name不能超过50个字符")
@ExcelProperty("结算部门name")
private String settleDepartName;
/** /**
* 累计应纳税所得 * 个人社保
*/ */
@ExcelAttribute(name = "累计应纳税所得") @ExcelAttribute(name = "个人社保")
@ExcelProperty("累计应纳税所得") @ExcelProperty("个人社保")
private BigDecimal taxable; private BigDecimal personalSocial;
/** /**
* 税率 * 税率
*/ */
...@@ -202,12 +235,7 @@ public class TStatisticsCurrentReport { ...@@ -202,12 +235,7 @@ public class TStatisticsCurrentReport {
@ExcelAttribute(name = "速算扣除") @ExcelAttribute(name = "速算扣除")
@ExcelProperty("速算扣除") @ExcelProperty("速算扣除")
private BigDecimal quickDeducation; private BigDecimal quickDeducation;
/**
* 累计应纳税额
*/
@ExcelAttribute(name = "累计应纳税额")
@ExcelProperty("累计应纳税额")
private BigDecimal salaryTax;
/** /**
* 单位id * 单位id
*/ */
...@@ -235,11 +263,6 @@ public class TStatisticsCurrentReport { ...@@ -235,11 +263,6 @@ public class TStatisticsCurrentReport {
@ExcelAttribute(name = "专项汇总") @ExcelAttribute(name = "专项汇总")
@ExcelProperty("专项汇总") @ExcelProperty("专项汇总")
private BigDecimal specialDeduMoney; private BigDecimal specialDeduMoney;
/**
* 累计婴幼儿照护费用
*/
@ExcelAttribute(name = "累计婴幼儿照护费用")
@ExcelProperty("累计婴幼儿照护费用")
private BigDecimal sumBabyMoney;
} }
...@@ -241,5 +241,22 @@ public class TStatisticsTaxSalary { ...@@ -241,5 +241,22 @@ public class TStatisticsTaxSalary {
@ExcelAttribute(name = "累计婴幼儿照护费用") @ExcelAttribute(name = "累计婴幼儿照护费用")
@ExcelProperty("累计婴幼儿照护费用") @ExcelProperty("累计婴幼儿照护费用")
private BigDecimal sumBabyMoney; 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 @@ ...@@ -16,11 +16,13 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.salary.vo; 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 com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Set;
/** /**
* 统计-本期申报 * 统计-本期申报
...@@ -37,6 +39,10 @@ public class TStatisticsCurrentReportSearchVo extends TStatisticsCurrentReport { ...@@ -37,6 +39,10 @@ public class TStatisticsCurrentReportSearchVo extends TStatisticsCurrentReport {
@Schema(description = "选中ID,多个逗号分割") @Schema(description = "选中ID,多个逗号分割")
private String ids; 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; ...@@ -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.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; 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.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.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport; import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsCurrentReport;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService; import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsCurrentReportService;
...@@ -92,6 +93,20 @@ public class TStatisticsCurrentReportController { ...@@ -92,6 +93,20 @@ public class TStatisticsCurrentReportController {
tStatisticsCurrentReportService.listExport(response, searchVo); 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 * @param
* @Description: 生成本期申报 * @Description: 生成本期申报
......
...@@ -74,7 +74,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics ...@@ -74,7 +74,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TStatisticsCurrentReportSearchVo searchVo) { public void listExport(HttpServletResponse response, TStatisticsCurrentReportSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "本期申报批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TStatisticsCurrentReport> list = new ArrayList<>(); List<TStatisticsCurrentReport> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = noPageCountDiy(searchVo);
...@@ -85,8 +85,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics ...@@ -85,8 +85,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8")); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list); ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsCurrentReport.class).includeColumnFiledNames(searchVo.getExportFields()).build();
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsCurrentReport.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; ) {
...@@ -101,7 +100,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics ...@@ -101,7 +100,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
} }
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("统计-本期申报" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("本期申报" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
...@@ -111,7 +110,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics ...@@ -111,7 +110,7 @@ public class TStatisticsCurrentReportServiceImpl extends ServiceImpl<TStatistics
} }
} }
} else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("统计-本期申报" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("本期申报" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
......
...@@ -478,6 +478,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -478,6 +478,7 @@ public class SalaryAccountUtil implements Serializable {
newEmp.setUnitNo(dept.getCustomerCode()); newEmp.setUnitNo(dept.getCustomerCode());
newEmp.setCreateBy(String.valueOf(user.getId())); newEmp.setCreateBy(String.valueOf(user.getId()));
newEmp.setCreateName(user.getNickname()); newEmp.setCreateName(user.getNickname());
newEmp.setInvoiceTitle(invoiceTitle);
if (!"3".equals(salaryType) && !"4".equals(salaryType)) { if (!"3".equals(salaryType) && !"4".equals(salaryType)) {
minTaxMonth = tSalaryAccountService.getMinTaxMonthByNowYear(newEmp.getEmpIdcard(), nowYear); minTaxMonth = tSalaryAccountService.getMinTaxMonthByNowYear(newEmp.getEmpIdcard(), nowYear);
if (Common.isNotNull(minTaxMonth) if (Common.isNotNull(minTaxMonth)
...@@ -572,8 +573,21 @@ public class SalaryAccountUtil implements Serializable { ...@@ -572,8 +573,21 @@ public class SalaryAccountUtil implements Serializable {
errorList.add(new ErrorMessage((i + 2), error)); errorList.add(new ErrorMessage((i + 2), error));
continue; continue;
} }
if (Common.isEmpty(emp.getBankProvince())) {
error = "第" + (i + 2) + "行:员工:" + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
if (Common.isEmpty(emp.getBankCity())) {
error = "第" + (i + 2) + "行:员工:" + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
entity.setBankName(emp.getBankName()); entity.setBankName(emp.getBankName());
entity.setBankNo(emp.getBankNo()); entity.setBankNo(emp.getBankNo());
entity.setBankProvince(String.valueOf(emp.getBankProvince()));
entity.setBankCity(String.valueOf(emp.getBankCity()));
entity.setBankSubName(emp.getBankSubName());
} else { } else {
if (Common.isNotNull(emp.getBankName())) { if (Common.isNotNull(emp.getBankName())) {
entity.setBankName(emp.getBankName()); entity.setBankName(emp.getBankName());
...@@ -585,6 +599,21 @@ public class SalaryAccountUtil implements Serializable { ...@@ -585,6 +599,21 @@ public class SalaryAccountUtil implements Serializable {
} else { } else {
entity.setBankNo(null); entity.setBankNo(null);
} }
if (Common.isNotNull(emp.getBankSubName())) {
entity.setBankSubName(emp.getBankSubName());
} else {
entity.setBankSubName(null);
}
if (Common.isNotNull(emp.getBankProvince())) {
entity.setBankProvince(String.valueOf(emp.getBankProvince()));
} else {
entity.setBankProvince(null);
}
if (Common.isNotNull(emp.getBankCity())) {
entity.setBankCity(String.valueOf(emp.getBankCity()));
} else {
entity.setBankCity(null);
}
} }
if (!"3".equals(salaryType) && !"4".equals(salaryType)) { if (!"3".equals(salaryType) && !"4".equals(salaryType)) {
if (emp.getTaxMonth().length() > CommonConstants.dingleDigitIntArray[6]) { if (emp.getTaxMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
<result property="unitNo" column="unit_no"/> <result property="unitNo" column="unit_no"/>
<result property="unitName" column="unit_name"/> <result property="unitName" column="unit_name"/>
<result property="sumBabyMoney" column="sum_baby_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> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -89,7 +92,10 @@ ...@@ -89,7 +92,10 @@
a.unit_id, a.unit_id,
a.unit_no, a.unit_no,
a.unit_name, a.unit_name,
a.sum_baby_money a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
</sql> </sql>
<sql id="tSalaryAccount2022_where"> <sql id="tSalaryAccount2022_where">
<if test="tSalaryAccount2022 != null"> <if test="tSalaryAccount2022 != null">
...@@ -211,7 +217,7 @@ ...@@ -211,7 +217,7 @@
insert into ${tableName} ( insert into ${tableName} (
select select
a.id,a.INVOICE_TITLE,a.EMP_ID,a.EMP_NAME,a.EMP_IDCARD, 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(sum(relaySalary.SALARY_MONEY),0) REAL_SALARY,
ifnull(max(costReduction.SALARY_MONEY),0) cost_reduction, ifnull(max(costReduction.SALARY_MONEY),0) cost_reduction,
ifnull(max(specialDeduMoney.SALARY_MONEY),0) SPECIAL_DEDU_MONEY, ifnull(max(specialDeduMoney.SALARY_MONEY),0) SPECIAL_DEDU_MONEY,
...@@ -230,12 +236,14 @@ ...@@ -230,12 +236,14 @@
ifnull(sum(if(annualBonusTax.SALARY_MONEY > 0,annualBonus.SALARY_MONEY,0)),0) annual_bonus, 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(annualBonusTax.SALARY_MONEY),0) annual_bonus_tax,
ifnull(sum(exemptionPersionTax.SALARY_MONEY),0) exemption_persion_tax, ifnull(sum(exemptionPersionTax.SALARY_MONEY),0) exemption_persion_tax,
i.id unit_id,i.CUSTOMER_CODE unit_no,i.CUSTOMER_NAME unit_name, s.unit_id,s.unit_no,s.unit_name,
ifnull(max(sumBabyMoney.SALARY_MONEY),0) sum_baby_money 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 from t_salary_account a
left join t_salary_standard s on s.id = a.SALARY_FORM_ID 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 t_salary_employee e on e.id = a.EMP_ID
left join hrms.t_customer_info i on i.id = d.CUSTOMER_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 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 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' left join t_salary_account_item costReduction on costReduction.SALARY_ACCOUNT_ID = a.id and costReduction.JAVA_FIED_NAME='costReduction'
...@@ -256,8 +264,7 @@ ...@@ -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 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' left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME='annualBonus'
where where
a.SETTLEMENT_MONTH = #{lastMonth} and a.DELETE_FLAG = 0 and a.SALARY_TYPE != '7' and a.SALARY_TYPE != '3' a.SETTLEMENT_MONTH = #{lastMonth} and a.DELETE_FLAG = 0 and a.FORM_TYPE != '7' and a.FORM_TYPE != '3' and s.DELETE_FLAG = 0
and s.DELETE_FLAG = 0
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,a.SETTLEMENT_MONTH) GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,a.SETTLEMENT_MONTH)
</insert> </insert>
......
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
<result property="unitName" column="UNIT_NAME"/> <result property="unitName" column="UNIT_NAME"/>
<result property="specialDeduMoney" column="SPECIAL_DEDU_MONEY"/> <result property="specialDeduMoney" column="SPECIAL_DEDU_MONEY"/>
<result property="sumBabyMoney" column="sum_baby_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> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.id, a.id,
...@@ -87,7 +90,10 @@ ...@@ -87,7 +90,10 @@
a.UNIT_NO, a.UNIT_NO,
a.UNIT_NAME, a.UNIT_NAME,
a.SPECIAL_DEDU_MONEY, a.SPECIAL_DEDU_MONEY,
a.sum_baby_money a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
</sql> </sql>
<sql id="tStatisticsCurrentReport_where"> <sql id="tStatisticsCurrentReport_where">
<if test="tStatisticsCurrentReport != null"> <if test="tStatisticsCurrentReport != null">
...@@ -231,7 +237,10 @@ ...@@ -231,7 +237,10 @@
s.UNIT_NO, s.UNIT_NO,
s.UNIT_NAME, s.UNIT_NAME,
s.SPECIAL_DEDU_MONEY, 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 from t_statistics_tax_salary s
left join left join
( (
......
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
<result property="unitName" column="UNIT_NAME"/> <result property="unitName" column="UNIT_NAME"/>
<result property="specialDeduMoney" column="SPECIAL_DEDU_MONEY"/> <result property="specialDeduMoney" column="SPECIAL_DEDU_MONEY"/>
<result property="sumBabyMoney" column="sum_baby_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> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.id, a.id,
...@@ -87,7 +90,10 @@ ...@@ -87,7 +90,10 @@
a.UNIT_NO, a.UNIT_NO,
a.UNIT_NAME, a.UNIT_NAME,
a.SPECIAL_DEDU_MONEY, a.SPECIAL_DEDU_MONEY,
a.sum_baby_money a.sum_baby_money,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
</sql> </sql>
<sql id="tStatisticsTaxSalary_where"> <sql id="tStatisticsTaxSalary_where">
<if test="tStatisticsTaxSalary != null"> <if test="tStatisticsTaxSalary != null">
...@@ -207,7 +213,10 @@ ...@@ -207,7 +213,10 @@
,a.REAL_SALARY,a.PERSONAL_PENSION_MONEY,a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY ,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 ,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 ,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 ( from (
SELECT SELECT
concat(a.id,#{nowMonth}) id, concat(a.id,#{nowMonth}) id,
...@@ -244,7 +253,10 @@ ...@@ -244,7 +253,10 @@
sum(a.enterprise_annuity) enterprise_annuity, sum(a.enterprise_annuity) enterprise_annuity,
a.unit_id, a.unit_id,
a.unit_no, a.unit_no,
a.unit_name a.unit_name,
a.IS_NEW_EMPLOYEE,
a.CREATE_MONTH,
a.EMP_PHONE
FROM ${tableName} a FROM ${tableName} a
where a.SETTLEMENT_MONTH <![CDATA[ <= ]]> #{nowMonth} and a.SETTLEMENT_MONTH like concat(#{lastYear},'%') 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 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