考勤调整

This commit is contained in:
andy 2025-07-10 13:34:33 +08:00
parent 4cc93a0f16
commit d61d08fcbc
3 changed files with 48 additions and 10 deletions

View File

@ -1,5 +1,6 @@
package com.evo.common.utils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.evo.attendance.domain.RzSysParam;
import com.evo.attendance.service.IRzSysParamService;
@ -11,6 +12,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -277,4 +279,40 @@ public class ParamUtils {
return holidaysMaps.entrySet().stream().filter(m -> holidayType.equals(m.getValue())).map(m-> m.getKey()).collect(Collectors.toList());
}
/***
* 获取全薪假期
* @return
*/
public static List<Long> getFullPaidLeave(){
RzSysParam param= paramService.getRzSysParam("全薪发放的假期", "full_paid_leave","54,56,58,59,60","全薪发放的假期; 54-年休假,56-婚假,58-陪产假,59-丧假,60-工伤假");
return Collections.asList(param.getParamValue().split(",")).stream().filter(StringUtils::isNotEmpty).map(Long::valueOf).collect(Collectors.toList());
}
/***
* 获取80%假期
* @return
*/
public static List<Long> getEightyPercentVacation(){
RzSysParam param= paramService.getRzSysParam("80%的假期类型", "eighty_percent_vacation","52","80%的假期类型; 52-病假");
return Collections.asList(param.getParamValue().split(",")).stream().filter(StringUtils::isNotEmpty).map(Long::valueOf).collect(Collectors.toList());
}
/***
* 获取80%假期
* @param nameAndIdCard 姓名-身份证
* @return
*/
public static BigDecimal getSpecialExemptionAmount(String nameAndIdCard){
RzSysParam param= paramService.getRzSysParam("特殊年度免征额计算", "special_exemption_amount",JSON.toJSONString(Collections.asMap("60000","李欣-130132199103134105;陈阳-130823200405243013;檀亚茹-130124199008242423;师敏玲-130132198610153189;马君君-130133199005203011;赵芬静-130132200109252589;李亚茹-130132199105122861;侯阔-130124198805202411;贺光建-130528198608083019;宋娇娇-130132198811222865;张子豪-130132200505170016;位晓峰-130132199211012877;周红娟-13013219820321284X;周庆迪-342221199208256085;赵硕岐-130132199210280052;李宏叶-130132198902060021;吴海静-130132198701021966;何亚平-130132198407011943;谷丽博-130132198612102887;楚世光-130105196807301212;杜晓华-130132198402093804;姚少鹏-130132199412151937;常志涛-130726200203256135;何旭然-130132198812093268;曹盼-130185199207201360;王硕-130132198701102934;何春玲-431124198612294526;王旭-130132199007270035;郑杰-130426199310292324;崔炫宇-130429200008068019;王晓田-130132199010252903;刘建斌-130105196908150919;崔佳佩-130132198602261323")),"特殊年度免征额计算, 上年各月均有申报且全年收入不超过6万元 所以今年免征额直接60000了");
Map<String, String> vm = JSON.parseObject(param.getParamValue(), Map.class);
for(Map.Entry<String, String> entry : vm.entrySet()){
if(Collections.asList(entry.getValue().split(";")).contains(nameAndIdCard)){
return new BigDecimal(entry.getKey());
}
}
return null;
}
}

View File

@ -230,18 +230,23 @@ public interface SalaryCalculationStrategyExchangeProcessor {
int curr_month = rzSalaryDetail.getMonth().getMonth();
//获取工资统计月份,查询上个月的纳税公司 得到年度免征额
RzSalaryDetail old_rzSalary = rzSalaryDetailMapper.selectRzSalaryDetailByStaffId(rzSalaryDetail.getStaffId());
BigDecimal annualExemptionAmount = new BigDecimal("5000.00");
if(curr_month == 12){
rzSalaryDetail.setAnnualExemptionAmount(new BigDecimal("5000.00"));
annualExemptionAmount = new BigDecimal("5000.00");
}else{
//判断员工为 新入职公司纳税主题改变同一主题超一年的同一主题不超一年但跨年的
if(StringUtils.isNull(old_rzSalary) || !old_rzSalary.getWbFlag().equals(sysStaff.getCompanyName())
|| (rzSalaryDetail.getMonth().getTime() - old_rzSalary.getMonth().getTime())/1000/60/60/24 > 365
|| (old_rzSalary.getMonth().getMonth() < 12 && old_rzSalary.getMonth().getMonth() > rzSalaryDetail.getMonth().getMonth())){
rzSalaryDetail.setAnnualExemptionAmount(new BigDecimal("5000.00"));
annualExemptionAmount = new BigDecimal("5000.00");
}else{
rzSalaryDetail.setAnnualExemptionAmount(new BigDecimal("5000.00").add(old_rzSalary.getAnnualExemptionAmount()));
annualExemptionAmount = new BigDecimal("5000.00").add(old_rzSalary.getAnnualExemptionAmount());
}
}
rzSalaryDetail.setAnnualExemptionAmount(DataUtils.findDefaultValue(ParamUtils.getSpecialExemptionAmount(sysStaff.getName()+"-"+sysStaff.getIdCard()), annualExemptionAmount));
// 本年累计已发工资本年累计已发工资+本月税前工资
rzSalaryDetail.setTotalWages(detail.getTotalWages().add(rzSalaryDetail.getSalaryBeforeTax()));
// 专项附加扣除六项附加扣除额相加

View File

@ -1,12 +1,9 @@
package com.evo.finance.processor.impl;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.evo.attendance.domain.RzAttendance;
import com.evo.attendance.domain.RzAttendanceStatistical;
import com.evo.attendance.mapper.RzAttendanceMapper;
import com.evo.common.constant.Constants;
import com.evo.common.utils.Collections;
import com.evo.common.utils.DataUtils;
import com.evo.common.utils.DateUtils;
import com.evo.common.utils.ParamUtils;
@ -39,8 +36,6 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
private RzAttendanceMapper rzAttendanceMapper;
@Resource
private RzLeaveDetailMapper rzLeaveDetailMapper;
private List<Long> qx = Collections.asList(56l,58l,59l,83l,60l);
private List<Long> qx8 = Collections.asList(52l);
@Override
@ -109,7 +104,7 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
* 工伤假 不包含补贴
*/
Long total8Hour = 0l;
for (Long type: qx8) {
for (Long type: ParamUtils.getEightyPercentVacation()) {
Long hour = rzLeaveDetailMapper.selectLeaveHourByUserIdAndDateAndType(sysStaff.getUserId(), rzSalaryDetail.getMonth(), type);
if(hour.compareTo(0l)> 0){
total8Hour = total8Hour+ hour;
@ -121,7 +116,7 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
rzSalaryDetail.setMonthSalary(rzSalaryDetail.getMonthSalary().add(gs));
}
Long totalAllHour = 0l;
for (Long type: qx) {
for (Long type: ParamUtils.getFullPaidLeave()) {
Long hour = rzLeaveDetailMapper.selectLeaveHourByUserIdAndDateAndType(sysStaff.getUserId(), rzSalaryDetail.getMonth(), type);
if(hour.compareTo(0l)> 0){
totalAllHour = totalAllHour+hour;