Commit 04955658 authored by fangxinjiang's avatar fangxinjiang

社保公积金自动化定时任务+社保公积金起缴日期+户截止日配置-fxj

parent 7ba27a0c
...@@ -68,7 +68,7 @@ public class TAutoFundRuleInfo extends BaseEntity { ...@@ -68,7 +68,7 @@ public class TAutoFundRuleInfo extends BaseEntity {
@Schema(description = "是否自动触发派增(字典:0自动触发派增,1:手动派增)") @Schema(description = "是否自动触发派增(字典:0自动触发派增,1:手动派增)")
private String autoFlag; private String autoFlag;
/** /**
* 派单发起时间(字典:0:起缴日期当日) * 派单发起时间(字典:0:起缴日期当日) 新:0:按起缴日期计算得出
*/ */
@ExcelAttribute(name = "派单发起时间", maxLength = 2) @ExcelAttribute(name = "派单发起时间", maxLength = 2)
@Length(max = 2, message = "派单发起时间不能超过2个字符") @Length(max = 2, message = "派单发起时间不能超过2个字符")
......
...@@ -93,12 +93,14 @@ public class TAutoFundRuleRel extends BaseEntity { ...@@ -93,12 +93,14 @@ public class TAutoFundRuleRel extends BaseEntity {
@Schema(description = "公积金单位个人比例是否一致(0-是,1-否)") @Schema(description = "公积金单位个人比例是否一致(0-是,1-否)")
private String fundPerFlag; private String fundPerFlag;
/** /**
* 起缴日期类型:0 入职日期 1 入职满1年次月 2 人员自定义 * 起缴日期类型:0 入职日期 1 入职满个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月
* * 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
* 原:0 入职日期 1 入职满1年次月 2 人员自定义
*/ */
@ExcelAttribute(name = "起缴日期类型", maxLength = 2) @ExcelAttribute(name = "起缴日期类型", maxLength = 2)
@Length(max = 2, message = "起缴日期类型不能超过2个字符") @Length(max = 2, message = "起缴日期类型不能超过2个字符")
@ExcelProperty("起缴日期类型") @ExcelProperty("起缴日期类型")
@Schema(description = "起缴日期类型:0 入职日期 1 入职满1年次月 2 人员自定义") @Schema(description = "起缴日期类型:0 入职日期 1 入职满个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月 ")
private String fundDateType; private String fundDateType;
/** /**
* 缴纳基数类型:0最低、1自定义、2最高、3固定基数 * 缴纳基数类型:0最低、1自定义、2最高、3固定基数
......
...@@ -67,12 +67,12 @@ public class TAutoSocialRuleInfo extends BaseEntity { ...@@ -67,12 +67,12 @@ public class TAutoSocialRuleInfo extends BaseEntity {
@Schema(description = "是否自动触发派增(字典:0自动触发派增,1:手动派增)") @Schema(description = "是否自动触发派增(字典:0自动触发派增,1:手动派增)")
private String autoFlag; private String autoFlag;
/** /**
* 派单发起时间(字典::0:入职满1个月...入职满6个月) * 派单发起时间(字典::0:入职满1个月...入职满6个月) 新:6:按起缴日期计算得出
*/ */
@ExcelAttribute(name = "派单发起时间", maxLength = 2,isNotEmpty = false, errorInfo = "派单发起时间不能为空") @ExcelAttribute(name = "派单发起时间", maxLength = 2,isNotEmpty = false, errorInfo = "派单发起时间不能为空")
@Length(max = 2, message = "派单发起时间不能超过2个字符") @Length(max = 2, message = "派单发起时间不能超过2个字符")
@ExcelProperty("派单发起时间") @ExcelProperty("派单发起时间")
@Schema(description = "派单发起时间(字典::0:入职满1个月...入职满6个月)") @Schema(description = "派单发起时间(字典::0:入职满1个月...入职满6个月 6:按起缴日期计算得出)")
private String startPeriod; private String startPeriod;
/** /**
* 派单发起具体时间字典:0:15:20 * 派单发起具体时间字典:0:15:20
......
...@@ -94,12 +94,14 @@ public class TAutoSocialRuleRel extends BaseEntity { ...@@ -94,12 +94,14 @@ public class TAutoSocialRuleRel extends BaseEntity {
@Schema(description = "社保起缴日期是否一致(0-是,1-否)") @Schema(description = "社保起缴日期是否一致(0-是,1-否)")
private String socialDateFlag; private String socialDateFlag;
/** /**
* 起缴日期:0 入职日期 * 起缴日期类型:0 入职日期 1 入职满个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月
*/ * 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
@ExcelAttribute(name = "起缴日期", maxLength = 2) * 原:0 入职日期
@Length(max = 2, message = "起缴日期不能超过2个字符") */
@ExcelProperty("起缴日期") @ExcelAttribute(name = "起缴日期类型", maxLength = 2)
@Schema(description = "起缴日期:0 入职日期") @Length(max = 2, message = "起缴日期类型不能超过2个字符")
@ExcelProperty("起缴日期类型")
@Schema(description = "起缴日期类型:0 入职日期 1 入职满个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月")
private String socialDateType; private String socialDateType;
/** /**
* 缴纳类型:0最低、1自定义、2最高 * 缴纳类型:0最低、1自定义、2最高
......
...@@ -270,14 +270,25 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable { ...@@ -270,14 +270,25 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
private String registerId; private String registerId;
/** /**
* 起缴日期类型:0 入职日期 1 入职满1年次月 2 人员自定义 * 起缴日期类型:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
* 原:0 入职日期 1 入职满1年次月 2 人员自定义
*/ */
@ExcelAttribute(name = "起缴日期类型", maxLength = 2) @ExcelAttribute(name = "起缴日期类型", maxLength = 2)
@Length(max = 2, message = "起缴日期类型不能超过2个字符") @Length(max = 2, message = "起缴日期类型不能超过2个字符")
@ExcelProperty("起缴日期类型") @ExcelProperty("起缴日期类型")
@Schema(description = "起缴日期类型:0 入职日期 1 入职满1年次月 2 人员自定义") @Schema(description = "起缴日期类型:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月")
private String fundDateType; private String fundDateType;
/**
* 起缴日期类型:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
* 原:0 入职日期 1 入职满1年次月 2 人员自定义
*/
@ExcelAttribute(name = "起缴日期类型", maxLength = 2)
@Length(max = 2, message = "起缴日期类型不能超过2个字符")
@ExcelProperty("起缴日期类型")
@Schema(description = "起缴日期类型:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月")
private String socialDateType;
/** /**
* 公积金单位个人比例是否一致(0-是,1-否) * 公积金单位个人比例是否一致(0-是,1-否)
*/ */
......
...@@ -1090,10 +1090,31 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -1090,10 +1090,31 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
preVo.setTypeSub(CommonConstants.ZERO_STRING); preVo.setTypeSub(CommonConstants.ZERO_STRING);
preVo.setProcessStatus(CommonConstants.ZERO_STRING); preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setDispatchItem("养老、医疗、生育、失业、工伤、大病"); preVo.setDispatchItem("养老、医疗、生育、失业、工伤、大病");
if (CommonConstants.ZERO_STRING.equals(preVo.getIsCreateDate()) && Common.isEmpty(preVo.getSocialStartDate())) { if (CommonConstants.ZERO_STRING.equals(preVo.getIsCreateDate())) {
//原社保起缴日期类型为 0 入职日期 新:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月
// 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
if (Common.isEmpty(preVo.getSocialStartDate())) {
if (Common.isNotNull(preVo.getSocialDateType())){
TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(preVo.getSocialDateType()));
vo.setYearAfter(0);
vo.setRegistDate(pre.getJoinLeaveDate());
Date date = this.addYearsMonths(vo);
preVo.setSocialStartDate(date);
}else {
preVo.setSocialStartDate(pre.getJoinLeaveDate()); preVo.setSocialStartDate(pre.getJoinLeaveDate());
} }
} }
preVo.setBigailmentStart(preVo.getSocialStartDate());
preVo.setPensionStart(preVo.getSocialStartDate());
preVo.setMedicalStart(preVo.getSocialStartDate());
preVo.setBirthStart(preVo.getSocialStartDate());
preVo.setWorkInjuryStart(preVo.getSocialStartDate());
preVo.setUnemployStart(preVo.getSocialStartDate());
preVo.setSocialStartDate(preVo.getSocialStartDate());
}
}
//公积金待购买数据初始化 //公积金待购买数据初始化
private void initFundPreInfo(EmployeeRegistrationPreVo pre, TDispatchInfoPreVo preVo, private void initFundPreInfo(EmployeeRegistrationPreVo pre, TDispatchInfoPreVo preVo,
......
...@@ -1892,6 +1892,38 @@ public class DateUtil { ...@@ -1892,6 +1892,38 @@ public class DateUtil {
} }
} }
/**
* 设置日期中的天
*
* @param date 原始日期
* @param day 要设置的天数
* @return 修改后的日期
*/
public static Date setDayByDate(Date date, int day) {
Calendar cal = Calendar.getInstance();
if (date != null) {
cal.setTime(date);
} else {
log.warn("Input date is null, will use current date");
return null;
}
// 对day参数进行基本的有效性检查
if (day < 1 || day > 31) {
log.warn("Day must be between 1 and 31, but found: " + day);
return null;
}
// 如果day大于当月最大天数,则将day设置为当月最大天数,如2月为28日,但是day为31,则将day设置为当月最大天数28
int maxDayOfMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
if (day > maxDayOfMonth) {
day = maxDayOfMonth;
}
cal.set(Calendar.DAY_OF_MONTH, day);
return cal.getTime();
}
public static boolean isDate(String dateText) { public static boolean isDate(String dateText) {
if (dateText == null) { if (dateText == null) {
return true; return true;
...@@ -1937,4 +1969,18 @@ public class DateUtil { ...@@ -1937,4 +1969,18 @@ public class DateUtil {
} }
return false; return false;
} }
/**
* @Author fxj
* @Description 判断 日期 date 是否在 registDate 之后,在返回true,否则返回false
* @Date 15:10 2025/12/12
* @Param
* @return
**/
public static boolean isAfter(Date date, Date registDate) {
if (date.getTime() > registDate.getTime()) {
return true;
}
return false;
}
} }
...@@ -58,4 +58,8 @@ public class BaseSearchVO implements Serializable { ...@@ -58,4 +58,8 @@ public class BaseSearchVO implements Serializable {
private String resultIdFour; private String resultIdFour;
private String resultIdFourStatus; private String resultIdFourStatus;
private String name;
private String type;
} }
...@@ -432,4 +432,19 @@ public class SocialDaprUtils { ...@@ -432,4 +432,19 @@ public class SocialDaprUtils {
return res; return res;
} }
/**
* @Author fxj
* @Description 通过户名称及类型 获取到截止日,然后看是否为工作日,如果不是工作日则往前推,知道找到工作日,然后返回工作日
* @Date 14:22 2025/12/12
* @Param
* @return
**/
public R<THouseHoldLimitInnerVo> getWorkDayByDeadLineDay(BaseSearchVO paramVo) {
R<THouseHoldLimitInnerVo> res = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId()
,"/thouseholdlimit/inner/checkCanBeHandleByDeadLineDay", paramVo, THouseHoldLimitInnerVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("查询截止日对应的工作日信息失败!");
}
return res;
}
} }
...@@ -255,7 +255,7 @@ public class TEmployeeInsurancePreController { ...@@ -255,7 +255,7 @@ public class TEmployeeInsurancePreController {
* @date 2025-04-11 10:46:12 * @date 2025-04-11 10:46:12
* @return void * @return void
*/ */
@SysLog("每天下午三点二十推送待派单数据") @SysLog("每天下午三点二十或上午11点推送待派单数据")
@Inner @Inner
@PostMapping("/inner/pushDisConfrimInsurances") @PostMapping("/inner/pushDisConfrimInsurances")
public void pushDisConfrimInsurances() { public void pushDisConfrimInsurances() {
......
...@@ -649,7 +649,8 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -649,7 +649,8 @@ public class TDispatchInfoPre extends BaseEntity {
private String fundPerFlag; private String fundPerFlag;
/** /**
* 起缴日期:0 入职日期 * 起缴日期类型:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
* 原:0 入职日期 1 入职满1年次月 2 人员自定义
*/ */
@Length(max = 2, message = "起缴日期:0 入职日期 不能超过2 个字符") @Length(max = 2, message = "起缴日期:0 入职日期 不能超过2 个字符")
@ExcelAttribute(name = "起缴日期:0 入职日期", maxLength = 2) @ExcelAttribute(name = "起缴日期:0 入职日期", maxLength = 2)
...@@ -666,4 +667,14 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -666,4 +667,14 @@ public class TDispatchInfoPre extends BaseEntity {
@Schema(description = "公积金户ID") @Schema(description = "公积金户ID")
private String configHouseId; private String configHouseId;
/**
* 起缴日期类型:0 入职日期 1 入职满1个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月
* 原:0 入职日期
*/
@ExcelAttribute(name = "起缴日期类型", maxLength = 2)
@Length(max = 2, message = "起缴日期类型不能超过2个字符")
@ExcelProperty("起缴日期类型")
@Schema(description = "起缴日期类型:0 入职日期 1 入职满个月 2 入职满2个月 3 入职满3个月 4 入职满4个月 5 入职满5个月 6 入职满6个月 7 入职满7个月 8 入职满8个月 9 入职满9个月 10 入职满10个月 11 入职满11个月 12 入职满12个月")
private String socialDateType;
} }
/*
* 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.social.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 java.io.Serializable;
import java.util.Date;
/**
* 户截止日配置表
*
* @author fxj
* @date 2025-12-11 14:19:54
*/
@Data
public class THouseHoldLimitInnerVo extends RowIndex implements Serializable {
/**
* 户名
*/
private String name;
/**
* 户类型:0社保 1公积金
*/
private String type;
/**
* 派增截止(日)
*/
private String deadLineDay;
/**
* 派增办理规则:0当月办当月生效 1 当月办次月生效
*/
private String addHandleRule;
/**
* date
*/
private Date wordDate;
/**
* 是否可办理 true:可办理 false:不可办理
*/
private Boolean canBeHandle;
}
...@@ -371,12 +371,12 @@ public class TDispatchInfoPreController { ...@@ -371,12 +371,12 @@ public class TDispatchInfoPreController {
} }
/** /**
* 每天下午三点二十推送待购买数据 公积金可以通用 * 每天下午三点二十或三点或上午11点推送待购买数据 公积金可以通用
* @author huych * @author huych
* @date 2025-10-11 18:51:58 * @date 2025-10-11 18:51:58
* @return void * @return void
*/ */
@SysLog("每天下午三点二十推送待购买数据") @SysLog("每天下午三点二十或三点或上午11点推送待购买数据")
@Inner @Inner
@PostMapping("/inner/pushDisConfrimSocial") @PostMapping("/inner/pushDisConfrimSocial")
public void pushDisConfrimSocial() { public void pushDisConfrimSocial() {
......
...@@ -24,11 +24,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -24,11 +24,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.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.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; 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.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.THouseHoldLimit; import com.yifu.cloud.plus.v1.yifu.social.entity.THouseHoldLimit;
import com.yifu.cloud.plus.v1.yifu.social.service.THouseHoldLimitService; import com.yifu.cloud.plus.v1.yifu.social.service.THouseHoldLimitService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitInnerVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -85,6 +90,30 @@ public class THouseHoldLimitController { ...@@ -85,6 +90,30 @@ public class THouseHoldLimitController {
public R<THouseHoldLimit> getById(@PathVariable("id") String id) { public R<THouseHoldLimit> getById(@PathVariable("id") String id) {
return R.ok(tHouseHoldLimitService.getById(id)); return R.ok(tHouseHoldLimitService.getById(id));
} }
/**
* 通过户名称及类型查询到具体截止日期后去看是否为工作日,如果不是工作日则往前推,知道找到工作日,然后返回工作日
* 如果找不到对应截止日期,则返回null
* @param paramVo:户名称 type: 0 社保、1 公积金
* @return R
*/
@Operation(summary = "户名称及类型查询可用的截止日期", description = "通过户名称及类型查询到具体截止日期后去查询是否为工作日,如果不是工作日则往前推,直到找到工作日,然后返回工作日")
@PostMapping("/getWorkDayByDeadLineDay")
public R<THouseHoldLimitInnerVo> getWorkDayByDeadLineDay(@RequestBody BaseSearchVO paramVo) {
return R.ok(tHouseHoldLimitService.getWorkDayByDeadLineDay(paramVo));
}
/**
* 通过户名称及类型查询到具体截止日期后判断是否为工作日,如果不是工作往前推,直到找到工作日,
* 然后和当前日期进行比较,如果当前日期大于截止日期则返回false,否则返回true
* @param paramVo:name 户名称 type: 0 社保、1 公积金
* @return R
*/
@Inner
@Operation(summary = "户名称及类型查询可用的截止日期", description = "通过户名称及类型查询到具体截止日期后去查询是否为工作日,如果不是工作日则往前推,直到找到工作日,然后返回工作日")
@PostMapping("/inner/getWorkDayByDeadLineDay")
public THouseHoldLimitInnerVo getWorkDayByDeadLineDayInner(@RequestBody BaseSearchVO paramVo) {
return tHouseHoldLimitService.getWorkDayByDeadLineDay(paramVo);
}
/** /**
* 新增户截止日配置表 * 新增户截止日配置表
......
...@@ -22,8 +22,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -22,8 +22,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.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.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.THouseHoldLimit; import com.yifu.cloud.plus.v1.yifu.social.entity.THouseHoldLimit;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitInnerVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitSearchVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -49,4 +53,5 @@ public interface THouseHoldLimitService extends IService<THouseHoldLimit> { ...@@ -49,4 +53,5 @@ public interface THouseHoldLimitService extends IService<THouseHoldLimit> {
void listExport(HttpServletResponse response, THouseHoldLimitSearchVo searchVo); void listExport(HttpServletResponse response, THouseHoldLimitSearchVo searchVo);
THouseHoldLimitInnerVo getWorkDayByDeadLineDay(BaseSearchVO paramVo);
} }
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.social.service.impl; package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
...@@ -27,23 +25,21 @@ import com.alibaba.excel.read.listener.ReadListener; ...@@ -27,23 +25,21 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.THouseHoldLimit; import com.yifu.cloud.plus.v1.yifu.social.entity.THouseHoldLimit;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysHouseHoldInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.SysHouseHoldInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.THouseHoldLimitMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.THouseHoldLimitMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.THouseHoldLimitService; import com.yifu.cloud.plus.v1.yifu.social.service.THouseHoldLimitService;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THouseHoldLimitVo;
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.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -54,6 +50,7 @@ import java.io.IOException; ...@@ -54,6 +50,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*; import java.util.*;
/** /**
...@@ -68,6 +65,8 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe ...@@ -68,6 +65,8 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
@Autowired @Autowired
private SysHouseHoldInfoMapper sysHouseHoldInfoMapper; private SysHouseHoldInfoMapper sysHouseHoldInfoMapper;
@Autowired
private THolidayInfoService holidayInfoService;
/** /**
* 户截止日配置表简单分页查询 * 户截止日配置表简单分页查询
* *
...@@ -370,4 +369,57 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe ...@@ -370,4 +369,57 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
private boolean insertExcel(THouseHoldLimit insert) { private boolean insertExcel(THouseHoldLimit insert) {
return baseMapper.insert(insert) >= 1; return baseMapper.insert(insert) >= 1;
} }
/**
* 通过户名称及类型查询到具体截止日期后去看是否为工作日,如果不是工作日则往前推,知道找到工作日,然后返回工作日
* 如果找不到对应截止日期,则返回null
* @param paramVo:户名称 type: 0 社保、1 公积金
* @return R true 当月能办理 false 当月不能办理
*/
@Override
public THouseHoldLimitInnerVo getWorkDayByDeadLineDay(BaseSearchVO paramVo) {
THouseHoldLimit houseHoldLimit = baseMapper.selectOne(Wrappers.<THouseHoldLimit>query().lambda()
.eq(THouseHoldLimit::getName,paramVo.getName())
.eq(THouseHoldLimit::getType,paramVo.getType())
.last(CommonConstants.LAST_ONE_SQL));
if (null == houseHoldLimit){
return null;
}
THouseHoldLimitInnerVo limitInnerVo = null;
String deadLineDay = houseHoldLimit.getDeadLineDay();
if (Common.isNotNull(deadLineDay)) {
try {
TEmployeeInsuranceWorkDayVo vo = new TEmployeeInsuranceWorkDayVo();
// 设置RegistDate为当前月份对应的截止日期deadLineDay
Date registDate = DateUtil.setDayByDate(new Date(), Integer.parseInt(deadLineDay));
if (null == registDate) {
return null;
}
vo.setRegistDate(registDate);
vo.setType(CommonConstants.ONE_STRING);
holidayInfoService.selectBeforeOrAfterWorkDay(vo);
limitInnerVo = new THouseHoldLimitInnerVo();
limitInnerVo.setCanBeHandle(false);
limitInnerVo.setDeadLineDay(deadLineDay);
limitInnerVo.setName(houseHoldLimit.getName());
limitInnerVo.setType(houseHoldLimit.getType());
limitInnerVo.setWordDate(vo.getRegistDate());
limitInnerVo.setAddHandleRule(houseHoldLimit.getAddHandleRule());
// 判断当前日期是否在截止日期之后
// 如果当前时间在截止日之后,则表示不可以办理,返回false,否则返回true
if (vo.getRegistDate() != null) {
LocalTime currentTime = LocalTime.now();
LocalTime thresholdTime = LocalTime.of(15, 20);
int dayOffset = (currentTime.isBefore(thresholdTime) || currentTime.equals(thresholdTime)) ? 0 : 1;
if (!DateUtil.isAfter(DateUtil.getDateByDayNum(dayOffset), vo.getRegistDate())) {
limitInnerVo.setCanBeHandle(true);
}
}
} catch (NumberFormatException e) {
// 截止日期不是有效数字,返回null表示无法确定
return null;
}
}
return limitInnerVo;
}
} }
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