Commit d4d6ce21 authored by hongguangwu's avatar hongguangwu

1.7.21-薪资0申报

parent a6b8d1b0
...@@ -97,6 +97,17 @@ public class TSettleDomainController { ...@@ -97,6 +97,17 @@ public class TSettleDomainController {
return R.ok(tSettleDomainService.getPage(page, tSettleDomain)); return R.ok(tSettleDomainService.getPage(page, tSettleDomain));
} }
/**
* 获取薪资封面抬头的分页查询
* @param page
* @param invoiceTitleSalary
*/
@Operation(summary = "获取薪资封面抬头的分页查询", description = "获取薪资封面抬头的分页查询")
@GetMapping("/getInvoiceTitleSalaryPage")
public R<IPage<IdNameNoVo>> getInvoiceTitleSalaryPage(Page<String> page, @RequestParam(required = false) String invoiceTitleSalary) {
return R.ok(tSettleDomainService.getInvoiceTitleSalaryPage(page, invoiceTitleSalary));
}
/** /**
* 二级指标归属分页查询 * 二级指标归属分页查询
* *
......
...@@ -38,6 +38,8 @@ import java.util.List; ...@@ -38,6 +38,8 @@ import java.util.List;
public interface TSettleDomainMapper extends BaseMapper<TSettleDomain> { public interface TSettleDomainMapper extends BaseMapper<TSettleDomain> {
IPage<TSettleDomain> getPage(Page<TSettleDomain> page, @Param("tSettleDomain") TSettleDomain tSettleDomain); IPage<TSettleDomain> getPage(Page<TSettleDomain> page, @Param("tSettleDomain") TSettleDomain tSettleDomain);
// 薪资封面抬头
IPage<IdNameNoVo> getInvoiceTitleSalaryPage(Page<String> page, @Param("invoiceTitleSalary") String invoiceTitleSalary);
IPage<SecondBelongVo> getTwoBlongPage(Page<TSettleDomain> page, @Param("tSettleDomain") TSettleDomain tSettleDomain); IPage<SecondBelongVo> getTwoBlongPage(Page<TSettleDomain> page, @Param("tSettleDomain") TSettleDomain tSettleDomain);
......
...@@ -45,6 +45,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -45,6 +45,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain> * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain>
**/ **/
IPage<TSettleDomain> getPage(Page<TSettleDomain> page, TSettleDomain tSettleDomain); IPage<TSettleDomain> getPage(Page<TSettleDomain> page, TSettleDomain tSettleDomain);
IPage<IdNameNoVo> getInvoiceTitleSalaryPage(Page<String> page, String invoiceTitleSalary);
/** /**
* @param page * @param page
......
...@@ -104,6 +104,11 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -104,6 +104,11 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
return baseMapper.getPage(page, tSettleDomain); return baseMapper.getPage(page, tSettleDomain);
} }
@Override
public IPage<IdNameNoVo> getInvoiceTitleSalaryPage(Page<String> page, String invoiceTitleSalary) {
return baseMapper.getInvoiceTitleSalaryPage(page, invoiceTitleSalary);
}
@Override @Override
public IPage<SecondBelongVo> getTwoBlongPage(Page<TSettleDomain> page, TSettleDomain tSettleDomain) { public IPage<SecondBelongVo> getTwoBlongPage(Page<TSettleDomain> page, TSettleDomain tSettleDomain) {
return baseMapper.getTwoBlongPage(page, tSettleDomain); return baseMapper.getTwoBlongPage(page, tSettleDomain);
......
...@@ -298,6 +298,17 @@ ...@@ -298,6 +298,17 @@
order by CREATE_TIME desc order by CREATE_TIME desc
</select> </select>
<select id="getInvoiceTitleSalaryPage" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.IdNameNoVo">
SELECT
distinct a.INVOICE_TITLE_SALARY as name
FROM t_settle_domain a
WHERE a.DELETE_FLAG = '0' and a.INVOICE_TITLE_SALARY is not null
<if test="invoiceTitleSalary != null and invoiceTitleSalary.trim() != ''">
and a.INVOICE_TITLE_SALARY like concat('%',#{invoiceTitleSalary},'%')
</if>
order by CASE WHEN a.INVOICE_TITLE_SALARY = '安徽皖信人力资源管理有限公司' THEN 0 ELSE 1 END,CREATE_TIME desc
</select>
<select id="getTwoBlongPage" resultMap="tSettleDomainTwoMap"> <select id="getTwoBlongPage" resultMap="tSettleDomainTwoMap">
SELECT SELECT
a.DEPART_NO, a.DEPART_NO,
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util; package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard; import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile; import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
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.ErrorMessage;
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.dapr.config.DaprCheckProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @Author fxj * @Author fxj
* @Date 2022/7/11 * @Date 2022/7/11
...@@ -69,4 +77,40 @@ public class CheckDaprUtil { ...@@ -69,4 +77,40 @@ public class CheckDaprUtil {
return R.ok(); return R.ok();
} }
// 批量实名校验:传参示例:
/*if (Common.isNotNull(emp.getEmpIdcard())) {
idCardCheck = new TCheckIdCard();
idCardCheck.setIdCard(emp.getEmpIdcard());
idCardCheck.setName(emp.getEmpName());
idCardCheck.setCreateUser(user.getId());
idCardCheck.setReason(user.getNickname());
checkList.add(idCardCheck);
idCardList.add(emp.getEmpIdcard());
}*/
public Map<String, Boolean> checkIdCardBatch(List<TCheckIdCard> checkList) {
Map<String, Boolean> idCardMap = new HashMap<>();
if (!checkList.isEmpty()) {
R<CheckBatchVo> idCardR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCardBatch", checkList, CheckBatchVo.class, SecurityConstants.FROM_IN);
if (idCardR != null && idCardR.getData() != null) {
idCardMap = idCardR.getData().getCheckMap();
}
}
return idCardMap;
}
// 批量手机号校验
public Map<String, Boolean> checkPhoneBatch(List<String> phoneList) {
Map<String, Boolean> phoneCheckMap = new HashMap<>();
if (!phoneList.isEmpty()) {
R<CheckBatchVo> phoneR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkMobileBatch", phoneList, CheckBatchVo.class, SecurityConstants.FROM_IN);
if (phoneR != null && phoneR.getData() != null) {
phoneCheckMap = phoneR.getData().getCheckMap();
}
}
return phoneCheckMap;
}
} }
...@@ -151,5 +151,27 @@ public class SalaryTask { ...@@ -151,5 +151,27 @@ public class SalaryTask {
log.info("------------定时任务刷新不购买里的社保状态-定时任务结束------------"); log.info("------------定时任务刷新不购买里的社保状态-定时任务结束------------");
} }
/**
* @Author hgw
* @Description 定时任务-每月1日1点生成0申报
* @Date 2026-3-23
**/
public void createZeroByMonth() {
log.info("------------每月1日1点生成0申报-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(),daprSalarylProperties.getAppId(),"/tsalaryzero/inner/createZeroByMonth","", Object.class, SecurityConstants.FROM_IN);
log.info("------------每月1日1点生成0申报-定时任务结束------------");
}
/**
* @Author hgw
* @Description 定时任务-每日23点50分,生成增量0申报
* @Date 2026-3-23
**/
public void createZeroByDay() {
log.info("------------每日23点50分生成增量0申报-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(),daprSalarylProperties.getAppId(),"/tsalaryzero/inner/createZeroByDay","", Object.class, SecurityConstants.FROM_IN);
log.info("------------每日23点50分生成增量0申报-定时任务结束------------");
}
} }
\ No newline at end of file
/*
* 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.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
@Data
@TableName("t_salary_zero_2026")
@Schema(description = "0申报")
public class TSalaryZero {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 员工姓名
*/
@NotBlank(message = "员工姓名 不能为空")
@Length(max = 50, message = "员工姓名 不能超过50 个字符")
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名 不能为空", maxLength = 50)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@NotBlank(message = "身份证号 不能为空")
@Length(max = 25, message = "身份证号 不能超过25 个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 25)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Length(max = 11, message = "手机号码不能超过11个字符")
@ExcelProperty("手机号码")
@Schema(description = "手机号码")
private String empPhone;
/**
* 项目ID
*/
@ExcelAttribute(name = "项目ID", isNotEmpty = true, errorInfo = "项目ID不能为空", maxLength = 32)
@NotBlank(message = "项目ID不能为空")
@Length(max = 32, message = "项目ID不能超过32个字符")
@ExcelProperty("项目ID")
@Schema(description = "项目ID")
private String deptId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目名称不能为空", maxLength = 50)
@NotBlank(message = "项目名称不能为空")
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
@Schema(description = "项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目编码不能为空", maxLength = 50)
@NotBlank(message = "项目编码不能为空")
@Length(max = 50, message = "项目编码不能超过50个字符")
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
private String deptNo;
/**
* 结算月份
*/
@ExcelAttribute(name = "结算月份", isNotEmpty = true, errorInfo = "结算月份不能为空", maxLength = 6)
@NotBlank(message = "结算月份不能为空")
@Length(max = 6, message = "结算月份不能超过6个字符")
@ExcelProperty("结算月份")
@Schema(description = "结算月份")
private String settleMonth;
/**
* 封面抬头
*/
@NotBlank(message = "封面抬头不能为空")
@ExcelAttribute(name = "封面抬头", isNotEmpty = true, errorInfo = "封面抬头不能为空", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
@Schema(description = "封面抬头")
private String invoiceTitle;
/**
* 减除费用
*/
@NotNull(message = "减除费用不能为空")
@ExcelAttribute(name = "减除费用", isNotEmpty = true, errorInfo = "减除费用不能为空")
@ExcelProperty("减除费用")
@Schema(description = "减除费用")
private BigDecimal costReduction;
/**
* 计税月份
*/
@NotBlank(message = "计税月份 不能为空")
@Length(max = 6, message = "计税月份 不能超过6 个字符")
@ExcelAttribute(name = "计税月份", isNotEmpty = true, errorInfo = "计税月份 不能为空", maxLength = 6)
@ExcelProperty("计税月份")
@Schema(description = "计税月份")
private String taxMonth;
/**
* 数据来源:1:项目;2商险;3导入
*/
@ExcelAttribute(name = "数据来源:1:项目;2商险;3导入", isNotEmpty = true, errorInfo = "数据来源:1:项目;2商险;3导入不能为空", maxLength = 1)
@NotBlank(message = "数据来源:1:项目;2商险;3导入不能为空")
@Length(max = 1, message = "数据来源:1:项目;2商险;3导入不能超过1个字符")
@ExcelProperty("数据来源:1:项目;2商险;3导入")
@Schema(description = "数据来源:1:项目;2商险;3导入")
private String dataSource;
/**
* 导入人
*/
@ExcelAttribute(name = "导入人", maxLength = 10)
@Length(max = 10, message = "导入人不能超过10个字符")
@ExcelProperty("导入人")
@Schema(description = "导入人")
private String importerName;
/**
* 页面假删除0:正常;1:已删除;2存在报账假删除
*/
@ExcelAttribute(name = "页面假删除0:正常;1:已删除;2存在报账假删除", isNotEmpty = true, errorInfo = "页面假删除0:正常;1:已删除;2存在报账假删除不能为空")
@NotNull(message = "页面假删除0:正常;1:已删除;2存在报账假删除不能为空")
@ExcelProperty("页面假删除0:正常;1:已删除;2存在报账假删除")
@Schema(description = "页面假删除0:正常;1:已删除;2存在报账假删除")
private Integer deleteFlag;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@ExcelProperty("创建时间")
@Schema(description = "创建时间")
private LocalDateTime createTime;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author hgw
* @Date 2026-3-23 09:50:08
* @Description 通用金额Vo
* @Version 1.0
*/
@Data
public class KeyMoneyVo implements Serializable {
private String keyValue;
private BigDecimal moneyValue;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
@Data
@ColumnWidth(15)
public class TSalaryZeroExportVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
/**
* 员工姓名
*/
@Length(max = 50, message = "员工姓名 不能超过50 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@Length(max = 25, message = "身份证号 不能超过25 个字符")
@ExcelAttribute(name = "身份证号", maxLength = 25)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@Length(max = 11, message = "手机号码 不能超过11 个字符")
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 项目名称
*/
@NotBlank(message = "项目名称 不能为空")
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目名称 不能为空", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@NotBlank(message = "项目编码 不能为空")
@Length(max = 50, message = "项目编码 不能超过50 个字符")
@ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目编码 不能为空", maxLength = 50)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 结算月份
*/
@ExcelAttribute(name = "结算月份", isNotEmpty = true, errorInfo = "结算月份不能为空", maxLength = 6)
@NotBlank(message = "结算月份不能为空")
@Length(max = 6, message = "结算月份不能超过6个字符")
@ExcelProperty("结算月份")
@Schema(description = "结算月份")
private String settleMonth;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
@Schema(description = "封面抬头")
private String invoiceTitle;
/**
* 减除费用
*/
@ExcelAttribute(name = "减除费用")
@Schema(description = "减除费用")
@ExcelProperty("减除费用")
private BigDecimal costReduction;
/**
* 计税月份
*/
@Length(max = 6, message = "计税月份 不能超过6 个字符")
@ExcelAttribute(name = "计税月份", maxLength = 6)
@Schema(description = "计税月份")
@ExcelProperty("计税月份")
private String taxMonth;/**
* 数据来源:1:项目;2商险;3导入
*/
@ExcelAttribute(name = "数据来源", isNotEmpty = true, errorInfo = "数据来源:1:项目;2商险;3导入不能为空", maxLength = 1)
@NotBlank(message = "数据来源:1:项目;2商险;3导入不能为空")
@Length(max = 1, message = "数据来源:1:项目;2商险;3导入不能超过1个字符")
@ExcelProperty("数据来源")
@Schema(description = "数据来源:1:项目;2商险;3导入")
private String dataSource;
/**
* 导入人
*/
@ExcelAttribute(name = "导入人", maxLength = 10)
@Length(max = 10, message = "导入人不能超过10个字符")
@ExcelProperty("导入人")
@Schema(description = "导入人")
private String importerName;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
@Data
public class TSalaryZeroSearchVo extends TSalaryZero {
/**
* 菜单ID 获取查询权限使用
*/
private String mId;
/**
* 菜单ID 获取导出权限使用
*/
private String menuInfo;
/**
* 权限sql
*/
private String authSql;
// 年份
private String year;
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
@Data
public class TSalaryZeroVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@NotBlank(message = "员工姓名 不能为空")
@Length(max = 50, message = "员工姓名 不能超过50 个字符")
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名 不能为空", maxLength = 50)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@NotBlank(message = "身份证号 不能为空")
@Length(max = 25, message = "身份证号 不能超过25 个字符")
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 25)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@NotBlank(message = "手机号码 不能为空")
@Length(max = 11, message = "手机号码 不能超过11 个字符")
@ExcelAttribute(name = "手机号码", isNotEmpty = true, errorInfo = "手机号码 不能为空", maxLength = 11)
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 项目名称
*/
@NotBlank(message = "项目名称 不能为空")
@Length(max = 50, message = "项目名称 不能超过50 个字符")
@ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目名称 不能为空", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@NotBlank(message = "项目编码 不能为空")
@Length(max = 50, message = "项目编码 不能超过50 个字符")
@ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目编码 不能为空", maxLength = 50)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 减除费用
*/
@NotNull(message = "减除费用不能为空")
@ExcelAttribute(name = "减除费用", isNotEmpty = true, errorInfo = "减除费用不能为空")
@Schema(description = "减除费用")
@ExcelProperty("减除费用")
private BigDecimal costReduction;
/**
* 计税月份
*/
@NotBlank(message = "计税月份 不能为空")
@Length(max = 6, message = "计税月份 不能超过6 个字符")
@ExcelAttribute(name = "计税月份", isNotEmpty = true, errorInfo = "计税月份 不能为空", maxLength = 6)
@Schema(description = "计税月份")
@ExcelProperty("计税月份")
private String taxMonth;
}
...@@ -52,6 +52,19 @@ public class WxConfig { ...@@ -52,6 +52,19 @@ public class WxConfig {
//未授权 //未授权
private String accossTokenInvliad = "40014"; private String accossTokenInvliad = "40014";
// 获取0申报表名称
public String getSalaryZeroTableName(String tableName) {
Object wxToken = redisTemplate.opsForValue().get(tableName);
if (null != wxToken) {
return String.valueOf(wxToken);
}
return null;
}
// 设置0申报表名称
public void setSalaryZeroTableName(String tableName) {
redisTemplate.opsForValue().set(tableName, tableName);
}
/** /**
* @param * @param
* @Author: huyc * @Author: huyc
......
/*
* 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.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryZeroService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryZeroSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsalaryzero")
@Tag(name = "0申报管理")
public class TSalaryZeroController {
private final TSalaryZeroService tSalaryZeroService;
private final MenuUtil menuUtil;
/**
* 定时任务-每月1日1点,生成0申报
*/
@Operation(description = "每月1日1点生成0申报")
@PostMapping("/inner/createZeroByMonth")
@Inner
public void createZeroByMonth() {
tSalaryZeroService.createZeroByMonth();
}
/**
* 定时任务-每日23点50分,生成增量0申报
*/
@Operation(description = "每日23点生成增量0申报")
@PostMapping("/inner/createZeroByDay")
@Inner
public void createZeroByDay() {
tSalaryZeroService.createZeroByDay();
}
/**
* 每月1日1点生成0申报
*/
@Operation(description = "测试-每月1日1点生成0申报")
@GetMapping("/testCreateZeroByMonth")
public void testCreateZeroByMonth() {
tSalaryZeroService.createZeroByMonth();
}
/**
* 每日23点生成增量0申报
*/
@Operation(description = "测试-每日23点生成增量0申报")
@GetMapping("/testCreateZeroByDay")
public void testCreateZeroByDay() {
tSalaryZeroService.createZeroByDay();
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param searchVo 0申报
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSalaryZero>> getTSalaryZeroPage(Page<TSalaryZero> page, TSalaryZeroSearchVo searchVo) {
this.setAuth(searchVo);
return new R<>(tSalaryZeroService.getTSalaryZeroPage(page, searchVo));
}
/**
* 设置权限
*/
private void setAuth(TSalaryZeroSearchVo tSalaryZero) {
YifuUser user = SecurityUtils.getUser();
BaseEntity baseEntity = new BaseEntity();
baseEntity.setMId(tSalaryZero.getMId());
baseEntity.setMenuInfo(tSalaryZero.getMenuInfo());
menuUtil.setAuthSql(user, baseEntity);
tSalaryZero.setAuthSql(baseEntity.getAuthSql());
}
/**
* 通过id查询0申报
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tsalaryzero_get')")
@GetMapping("/{id}")
public R<TSalaryZero> getById(@PathVariable("id") String id) {
return R.ok(tSalaryZeroService.getTSalaryZeroById(id));
}
/**
* 通过id删除0申报
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除0申报", description = "通过id删除0申报")
@SysLog("通过id删除0申报")
@GetMapping("/deleteTSalaryZeroById")
public R<Boolean> deleteTSalaryZeroById(@RequestParam String id) {
boolean a = tSalaryZeroService.deleteTSalaryZeroById(id);
if (a) {
return R.ok();
} else {
return R.failed();
}
}
/**
* 通过id删除0申报
*
* @param idList id
* @return R
*/
@Operation(summary = "通过idList批量删除0申报", description = "通过idList批量删除0申报")
@SysLog("通过idList批量删除0申报")
@PostMapping("/deleteZeroByIdList")
public R<Boolean> deleteZeroByIdList(@RequestBody List<String> idList) {
if (Common.isEmpty(idList)) {
return R.failed(ErrorCodes.PARAM_NOT_EMPTY);
} else {
tSalaryZeroService.deleteTSalaryZeroByIdList(idList);
}
return R.ok();
}
/**
* 0申报 批量导入( hasPermission('salary_tsalaryzero-batch-import'))
*
* @author hgw
* @date 2026-03-18 14:47:00
**/
@SneakyThrows
@Operation(description = "批量导入0申报")
@SysLog("批量导入0申报")
@PostMapping("/importSalaryZero")
public R<List<ErrorMessage>> importSalaryZero(@RequestBody MultipartFile file, @RequestParam String settleMonth, @RequestParam String invoiceTitle) {
return tSalaryZeroService.importSalaryZero(file.getInputStream(), settleMonth, invoiceTitle);
}
/**
* 0申报 批量导出
*
* @author hgw
* @date 2026-03-18 14:47:00
**/
@Operation(description = "导出0申报 hasPermission('salary_tsalaryzero-export')")
@PostMapping("/exportZero")
public void exportZero(HttpServletResponse response, @RequestBody TSalaryZeroSearchVo searchVo) {
this.setAuth(searchVo);
tSalaryZeroService.listExport(response, searchVo);
}
}
...@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper; ...@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.IdNameNoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial; import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
...@@ -27,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.*; ...@@ -27,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
...@@ -181,6 +183,9 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> { ...@@ -181,6 +183,9 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
List<TSalaryAccount> getAccountListBySalaryId(@Param("searchVo") TSalaryAccountSearchVo searchVo); List<TSalaryAccount> getAccountListBySalaryId(@Param("searchVo") TSalaryAccountSearchVo searchVo);
List<String> getAccountListByKey(@Param("invoiceTitle") String invoiceTitle, @Param("settleMonth") String settleMonth
, @Param("cardList") List<String> cardList);
// 导出报账专用hgw // 导出报账专用hgw
List<TSalaryAccountExportByEkpVo> getAccountListByApplyNo(@Param("applyNo") String applyNo); List<TSalaryAccountExportByEkpVo> getAccountListByApplyNo(@Param("applyNo") String applyNo);
...@@ -298,4 +303,10 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> { ...@@ -298,4 +303,10 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/ **/
List<TSalaryAccount> getIdCardListBySalaryId(@Param("salaryId") String salaryId); List<TSalaryAccount> getIdCardListBySalaryId(@Param("salaryId") String salaryId);
List<KeyMoneyVo> getCostReductionToAll(@Param("deptNo") String deptNo, @Param("invoiceTitle") String invoiceTitle
, @Param("tableName") String tableName, @Param("lastSettleMonth") String lastSettleMonth);
BigDecimal getCostReductionToCard(@Param("idCard") String idCard, @Param("invoiceTitle") String invoiceTitle
, @Param("tableName") String tableName, @Param("lastSettleMonth") String lastSettleMonth);
} }
/*
* 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.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryZeroExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryZeroSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
@Mapper
public interface TSalaryZeroMapper extends BaseMapper<TSalaryZero> {
// 单个查询
TSalaryZero getTSalaryZeroById(@Param("tableName") String tableName, @Param("id") String id);
// 单个删除
int deleteTSalaryZeroById(@Param("tableName") String tableName, @Param("id") String id);
// 批量删除
int deleteTSalaryZeroByIdList(@Param("tableName") String tableName, @Param("idList") String idList);
// 分页查询
IPage<TSalaryZero> getTSalaryZeroPage(Page<TSalaryZero> page, @Param("tableName") String tableName, @Param("tSalaryZero") TSalaryZeroSearchVo searchVo);
// 批量更新状态(deleteFlag0,1,2:0:正常;1:已删除;2存在报账假删除)
int updateDeleteFlagByIdList(@Param("tableName") String tableName, @Param("deleteFlag") Integer deleteFlag, @Param("idList") List<String> idList);
// 导出获取数据总数
long getTSalaryZeroCount(@Param("tableName") String tableName, @Param("tSalaryZero") TSalaryZeroSearchVo searchVo);
// 导出获取数据
List<TSalaryZeroExportVo> getTSalaryZeroExport(@Param("tableName") String tableName, @Param("tSalaryZero") TSalaryZeroSearchVo searchVo);
// 获取已存在的身份证去重
List<String> getIdListByCardAndTitleAndMonth(@Param("tableName") String tableName
, @Param("invoiceTitle") String invoiceTitle, @Param("settleMonth") String settleMonth, @Param("cardList") List<String> cardList);
/**
* @Description: 自动创建年度0申报表
* @Author: hgw
* @Date: 2026/3/18 16:32
**/
void createSalaryZeroYear(@Param("tableName") String tableName);
// 自动创建每月的0申报视图(1月创建含去年12月的计税月份)(2月更新成当年的上月的计税月份)
void createOrUpdateViewSalaryZeroYear(@Param("viewYearName") String viewYearName, @Param("tableNameOrLastTable") String tableNameOrLastTable);
// 自动创建每日的0申报视图(1月创建含去年12月的计税月份)(2月更新成当年的上月的计税月份)
void createOrUpdateViewSalaryZeroDay(@Param("viewDayName") String viewDayName, @Param("tableName") String tableName, @Param("tableNameOrLastTable") String tableNameOrLastTable);
// 每月1号生成当月0申报表
void insertIntoSalaryZeroYear(@Param("tableName") String tableName, @Param("viewYearName") String viewYearName);
// 每天23点生成当天0申报表
void insertIntoSalaryZeroNowDay(@Param("tableName") String tableName, @Param("viewDayName") String viewDayName);
// 判断表是否存在
int getTableExists(@Param("tableName") String tableName);
}
...@@ -98,6 +98,9 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> { ...@@ -98,6 +98,9 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/ **/
List<TSalaryAccount> getAccountListBySalaryId(TSalaryAccountSearchVo searchVo); List<TSalaryAccount> getAccountListBySalaryId(TSalaryAccountSearchVo searchVo);
// 根据抬头、结算月、身份证list获取是否存在
Map<String, Integer> getAccountMapByKey(String invoiceTitle, String settleMonth,List<String> keyList);
/** /**
* @param applyNo 薪酬申请编号 * @param applyNo 薪酬申请编号
* @Description: 导出报账专用hgw * @Description: 导出报账专用hgw
...@@ -250,4 +253,9 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> { ...@@ -250,4 +253,9 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/ **/
List<TSalaryAccount> getIdCardListBySalaryId(String salaryId); List<TSalaryAccount> getIdCardListBySalaryId(String salaryId);
// 获取上月减除费用,按项目
Map<String, BigDecimal> getCostReductionToAll(String deptNo, String invoiceTitle);
// 获取上月减除费用,单个身份证的
BigDecimal getCostReductionToCard(String idCard, String invoiceTitle);
} }
/*
* 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;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero;
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.salary.vo.TSalaryZeroSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 0申报
*
* @author hgw
* @date 2026-03-18 14:47:00
*/
public interface TSalaryZeroService extends IService<TSalaryZero> {
/**
* 0申报简单分页查询
* @param searchVo 0申报
* @return
*/
IPage<TSalaryZero> getTSalaryZeroPage(Page<TSalaryZero> page, TSalaryZeroSearchVo searchVo);
TSalaryZero getTSalaryZeroById(String id);
// 单个删除
boolean deleteTSalaryZeroById(String id);
// 批量删除
boolean deleteTSalaryZeroByIdList(List<String> idList);
// 批量更新状态(deleteFlag0,1,2:0:正常;1:已删除;2存在报账假删除)
int updateDeleteFlagByIdList(String year, Integer deleteFlag, List<String> idList);
R<List<ErrorMessage>> importSalaryZero(InputStream inputStream, String settleMonth, String invoiceTitle);
void listExport(HttpServletResponse response, TSalaryZeroSearchVo searchVo);
// 每月1日1点生成0申报
void createZeroByMonth();
// 每日23点生成增量0申报
void createZeroByDay();
}
...@@ -211,6 +211,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -211,6 +211,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
vo.setJsonString(jsonString); vo.setJsonString(jsonString);
SalaryAccountUtil util1 = new SalaryAccountUtil(); SalaryAccountUtil util1 = new SalaryAccountUtil();
// 初始化减除费用:
Map<String, BigDecimal> costReductionMap = tSalaryAccountService.getCostReductionToAll(dept.getDepartNo(), invoiceTitle);
TSalaryEmployee empSearch = new TSalaryEmployee(); TSalaryEmployee empSearch = new TSalaryEmployee();
empSearch.setUnitId(dept.getCustomerId()); empSearch.setUnitId(dept.getCustomerId());
List<TSalaryEmployee> empList = employeeService.list(Wrappers.<TSalaryEmployee>query().lambda() List<TSalaryEmployee> empList = employeeService.list(Wrappers.<TSalaryEmployee>query().lambda()
...@@ -271,7 +274,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -271,7 +274,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
util1.getJsonStringToList(user, vo, dept, configSalary, salaryConfigMap, isMustMap, util1.getJsonStringToList(user, vo, dept, configSalary, salaryConfigMap, isMustMap,
empIdCardMap, checkListY, invoiceTitle, empIdCardMap, checkListY, invoiceTitle,
employeeService, checkMap, specialMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService, bankMap); employeeService, checkMap, specialMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService, bankMap, costReductionMap);
List<TSalaryAccountVo> saList = util1.getEntityList(); List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) { if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
......
...@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.mapper.SysConfigLimitMapper; ...@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.mapper.SysConfigLimitMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TDeptSeeMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TDeptSeeMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService; import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*; import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -55,7 +56,9 @@ import javax.servlet.ServletOutputStream; ...@@ -55,7 +56,9 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -750,6 +753,20 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper, ...@@ -750,6 +753,20 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return baseMapper.getAccountListBySalaryId(searchVo); return baseMapper.getAccountListBySalaryId(searchVo);
} }
@Override
public Map<String, Integer> getAccountMapByKey(String invoiceTitle, String settleMonth, List<String> cardList) {
Map<String, Integer> map = new HashMap<>();
if (Common.isNotNull(cardList)) {
List<String> keyList = baseMapper.getAccountListByKey(invoiceTitle, settleMonth, cardList);
if (Common.isNotNull(keyList)) {
for (String key : keyList) {
map.put(key, CommonConstants.ONE_INT);
}
}
}
return map;
}
/** /**
* @param applyNo * @param applyNo
* @Description: 导出报账专用hgw * @Description: 导出报账专用hgw
...@@ -1004,4 +1021,59 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper, ...@@ -1004,4 +1021,59 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return baseMapper.getIdCardListBySalaryId(salaryId); return baseMapper.getIdCardListBySalaryId(salaryId);
} }
private String getTableName() {
LocalDateTime now = LocalDateTime.now();
int year = now.getYear();
return SalaryConstants.TABLE_NAME_PRE + year;
}
// 获取上月减除费用,按项目
@Override
public Map<String, BigDecimal> getCostReductionToAll(String deptNo, String invoiceTitle) {
Map<String, BigDecimal> map = new HashMap<>();
LocalDateTime now = LocalDateTime.now();
int month = now.getMonthValue();
// 1月自动5000,不查不计算
if (month != CommonConstants.ONE_INT) {
String tableName = getTableName();
String lastSettleMonth = DateUtil.addMonth(-1);
List<KeyMoneyVo> list = baseMapper.getCostReductionToAll(deptNo, invoiceTitle, tableName, lastSettleMonth);
if (Common.isNotNull(list)) {
BigDecimal money;
for (KeyMoneyVo vo : list) {
money = vo.getMoneyValue();
money = judgeMoneyAndAdd(money);
map.put(vo.getKeyValue(), money);
}
}
}
return map;
}
private BigDecimal judgeMoneyAndAdd(BigDecimal money) {
if (money != null) {
money = money.add(SalaryConstants.COST_MONEY).setScale(CommonConstants.ZERO_INT, RoundingMode.HALF_UP);
// 判断a是否超过60000,超过则返回6000
if (money.compareTo(SalaryConstants.MAX_COST_MONEY) > CommonConstants.ZERO_INT) {
money = SalaryConstants.MAX_COST_MONEY;
}
}
return money;
}
// 获取上月减除费用,单个身份证的
@Override
public BigDecimal getCostReductionToCard(String idCard, String invoiceTitle) {
String tableName = getTableName();
String lastSettleMonth = DateUtil.addMonth(-1);
LocalDateTime now = LocalDateTime.now();
int month = now.getMonthValue();
BigDecimal money = SalaryConstants.COST_MONEY;
// 1月自动5000,不查不计算
if (month != CommonConstants.ONE_INT) {
money = baseMapper.getCostReductionToCard(idCard, invoiceTitle, tableName, lastSettleMonth);
money = judgeMoneyAndAdd(money);
}
return money;
}
} }
...@@ -74,7 +74,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -74,7 +74,8 @@ public class SalaryAccountUtil implements Serializable {
, Map<String, TSalaryEmployee> empIdCardMap , Map<String, TSalaryEmployee> empIdCardMap
, List<String> checkListY, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService , List<String> checkListY, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, Map<String, Integer> checkMap, Map<String, BigDecimal> specialMap, Map<String, Integer> ownEmployeeMap , Map<String, Integer> checkMap, Map<String, BigDecimal> specialMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService, Map<String, String> bankMap) { , Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService, Map<String, String> bankMap
, Map<String, BigDecimal> costReductionMap) {
String jsonStr = vo.getJsonString(); String jsonStr = vo.getJsonString();
String salaryType = vo.getSalaryType(); String salaryType = vo.getSalaryType();
// 新员工是否更新:0否;1是 hgw 2024-7-18 16:36:31 // 新员工是否更新:0否;1是 hgw 2024-7-18 16:36:31
...@@ -488,7 +489,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -488,7 +489,8 @@ public class SalaryAccountUtil implements Serializable {
if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList
, entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle , entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle
, nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap , nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap
, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap)) , newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap, costReductionMap
, tSalaryAccountService, invoiceTitle))
continue; continue;
} }
if (saiList != null && !saiList.isEmpty()) { if (saiList != null && !saiList.isEmpty()) {
...@@ -589,7 +591,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -589,7 +591,8 @@ public class SalaryAccountUtil implements Serializable {
, CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee()) , CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee())
, otherEmp.getEmpName(), entity.getSalaryStyle() , otherEmp.getEmpName(), entity.getSalaryStyle()
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow , nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow
, bankMap, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap)) { , bankMap, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap, costReductionMap
, tSalaryAccountService, invoiceTitle)) {
isContinue = false; isContinue = false;
} }
} }
...@@ -698,7 +701,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -698,7 +701,8 @@ public class SalaryAccountUtil implements Serializable {
, boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth , boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth
, List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i , List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i
, Map<String, String> bankMap, String newEmpUpdateFlag, List<TSalaryEmployee> updateEmpBankList , Map<String, String> bankMap, String newEmpUpdateFlag, List<TSalaryEmployee> updateEmpBankList
, Map<String, TSalaryEmployee> updateEmpBankMap) { , Map<String, TSalaryEmployee> updateEmpBankMap, Map<String, BigDecimal> costReductionMap
, TSalaryAccountService tSalaryAccountService, String invoiceTitle) {
TSalaryAccountItemVo sai; TSalaryAccountItemVo sai;
String error; String error;
emp.setLineNums(i); emp.setLineNums(i);
...@@ -968,7 +972,14 @@ public class SalaryAccountUtil implements Serializable { ...@@ -968,7 +972,14 @@ public class SalaryAccountUtil implements Serializable {
sai = new TSalaryAccountItemVo(); sai = new TSalaryAccountItemVo();
sai.setCnName(SalaryConstants.COST_REDUCTION); sai.setCnName(SalaryConstants.COST_REDUCTION);
sai.setJavaFiedName(SalaryConstants.COST_REDUCTION_JAVA); sai.setJavaFiedName(SalaryConstants.COST_REDUCTION_JAVA);
sai.setSalaryMoney(DateUtil.getTaxMonthMoney(entity.getTaxMonth())); BigDecimal costReduction = costReductionMap.get(entity.getEmpIdcard());
if (costReduction == null) {
costReduction = tSalaryAccountService.getCostReductionToCard(entity.getEmpIdcard(), invoiceTitle);
}
if (costReduction == null) {
costReduction = SalaryConstants.COST_MONEY;
}
sai.setSalaryMoney(costReduction);
sai.setIsTax(CommonConstants.ZERO_INT); sai.setIsTax(CommonConstants.ZERO_INT);
saiList.add(sai); saiList.add(sai);
} }
......
...@@ -201,4 +201,19 @@ public class SalaryConstants { ...@@ -201,4 +201,19 @@ public class SalaryConstants {
public static final String SALARY_STYLE_XIAN = "现金"; public static final String SALARY_STYLE_XIAN = "现金";
public static final String SALARY_PHONES = "通讯补贴(不计税)"; public static final String SALARY_PHONES = "通讯补贴(不计税)";
public static final String IS_PERSON_TAX = "isPersonTax"; public static final String IS_PERSON_TAX = "isPersonTax";
// 0申报表面前缀
public static final String TABLE_NAME_PRE = "t_salary_zero_";
public static final String VIEW_YEAR_NAME_PRE = "view_salary_zero_year_";
public static final String VIEW_DAY_NAME_PRE = "view_salary_zero_day_";
public static final String MONEY_ERROR = "减除费用金额仅限5000~60000且是5000的倍数";
public static final String DEPT_ERROR = "根据项目编码未找到项目信息";
public static final BigDecimal COST_MONEY = new BigDecimal("5000");
// 最大减除费用
public static final BigDecimal MAX_COST_MONEY = new BigDecimal("60000");
// 同一个结算月、抬头有报账信息的提示语
public static final String HAVE_ACCOUNT = "员工报账查询中该人员在该月已经存在薪资数据";
// 同一个结算月、抬头有0申报信息的提示语
public static final String HAVE_ZERO = "0元申报表中该人员在该月已经存在";
} }
...@@ -1158,6 +1158,17 @@ ...@@ -1158,6 +1158,17 @@
GROUP BY a.id ORDER BY a.ROW_INDEX ASC GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select> </select>
<select id="getAccountListByKey" resultType="java.lang.String">
SELECT
a.EMP_IDCARD
FROM t_salary_account a
where a.INVOICE_TITLE = #{invoiceTitle} and a.SETTLEMENT_MONTH = #{settleMonth} and a.DELETE_FLAG = 0
and a.EMP_IDCARD in
<foreach item="idStr" index="index" collection="cardList" open="(" separator="," close=")">
#{idStr}
</foreach>
</select>
<!-- 导出报账专用hgw --> <!-- 导出报账专用hgw -->
<select id="getAccountListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo"> <select id="getAccountListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo">
select select
...@@ -2162,4 +2173,38 @@ ...@@ -2162,4 +2173,38 @@
where a.DELETE_FLAG = 0 and a.SALARY_FORM_ID = #{salaryId} where a.DELETE_FLAG = 0 and a.SALARY_FORM_ID = #{salaryId}
</select> </select>
<!-- 获取减除费用 -->
<select id="getCostReductionToAll" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.KeyMoneyVo">
select a.keyValue,a.moneyValue from (
SELECT
a.EMP_IDCARD as keyValue,
a.cost_reduction as moneyValue
FROM t_salary_account a
where a.DELETE_FLAG = 0 and a.DEPT_NO = #{deptNo} and a.INVOICE_TITLE = #{invoiceTitle} and a.SETTLEMENT_MONTH = #{lastSettleMonth}
union all
SELECT
a.EMP_IDCARD as keyValue,
a.cost_reduction as moneyValue
FROM ${tableName} a
where a.DELETE_FLAG = 0 and a.DEPT_NO = #{deptNo} and a.INVOICE_TITLE = #{invoiceTitle} and a.SETTLE_MONTH = #{lastSettleMonth}
) a GROUP BY a.keyValue
</select>
<!-- 获取减除费用-单个身份证的 -->
<select id="getCostReductionToCard" resultType="java.math.BigDecimal">
select a.moneyValue from (
SELECT
a.EMP_IDCARD as keyValue,
a.cost_reduction as moneyValue
FROM t_salary_account a
where a.DELETE_FLAG = 0 and a.EMP_IDCARD = #{idCard} and a.INVOICE_TITLE = #{invoiceTitle} and a.SETTLEMENT_MONTH = #{lastSettleMonth}
union all
SELECT
a.EMP_IDCARD as keyValue,
a.cost_reduction as moneyValue
FROM ${tableName} a
where a.DELETE_FLAG = 0 and a.EMP_IDCARD = #{idCard} and a.INVOICE_TITLE = #{invoiceTitle} and a.SETTLE_MONTH = #{lastSettleMonth}
) a limit 1
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment