定制-光阳,增加考勤周期规则
This commit is contained in:
parent
bf8f55aaa9
commit
8b87468c4f
|
|
@ -0,0 +1,11 @@
|
|||
ALTER TABLE hrsa_salary_sob ADD attend_cycle_end_day int NULL
|
||||
;
|
||||
|
||||
ALTER TABLE hrsa_salary_sob ADD attend_type int NULL
|
||||
;
|
||||
|
||||
ALTER TABLE hrsa_salary_sob ADD attend_cycle_type2 int NULL
|
||||
;
|
||||
|
||||
update hrsa_salary_sob set attend_cycle_type2 = 3, attend_cycle_end_day = 25, attend_type=1
|
||||
;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
ALTER TABLE hrsa_salary_sob ADD attend_cycle_end_day int NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE hrsa_salary_sob ADD attend_type int NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE hrsa_salary_sob ADD attend_cycle_type2 int NULL
|
||||
GO
|
||||
|
||||
update hrsa_salary_sob set attend_cycle_type2 = 3, attend_cycle_end_day = 25, attend_type=1
|
||||
GO
|
||||
|
|
@ -46,6 +46,9 @@ public class SalarySobBO {
|
|||
.taxCycleType(saveParam.getTaxCycleType())
|
||||
.attendCycleType(saveParam.getAttendCycleType())
|
||||
.attendCycleFromDay(saveParam.getAttendCycleFromDay())
|
||||
.attendCycleType2(saveParam.getAttendCycleType2())
|
||||
.attendCycleEndDay(saveParam.getAttendCycleEndDay())
|
||||
.attendType(saveParam.getAttendType())
|
||||
.socialSecurityCycleType(saveParam.getSocialSecurityCycleType())
|
||||
.disable(NumberUtils.INTEGER_ZERO)
|
||||
.creator(employeeId)
|
||||
|
|
@ -141,6 +144,9 @@ public class SalarySobBO {
|
|||
.setTaxCycleType(salarySobPO.getTaxCycleType())
|
||||
.setAttendCycleType(salarySobPO.getAttendCycleType())
|
||||
.setAttendCycleFromDay(salarySobPO.getAttendCycleFromDay())
|
||||
.setAttendCycleType2(salarySobPO.getAttendCycleType2())
|
||||
.setAttendCycleEndDay(salarySobPO.getAttendCycleEndDay())
|
||||
.setAttendType(salarySobPO.getAttendType())
|
||||
.setSocialSecurityCycleType(salarySobPO.getSocialSecurityCycleType())
|
||||
.setTaxAgentId(salarySobPO.getTaxAgentId())
|
||||
.setDescription(salarySobPO.getDescription());
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public class SalarySobCycleBO {
|
|||
.socialSecurityCycle(buildCycle(salaryMonth, salarySob.getSocialSecurityCycleType()))
|
||||
.salaryCycle(buildCycleDateRange(salaryMonth, salarySob.getSalaryCycleType(), salarySob.getSalaryCycleFromDay()))
|
||||
.attendCycle(buildCycleDateRange(salaryMonth, salarySob.getAttendCycleType(), salarySob.getAttendCycleFromDay()))
|
||||
.attendCycle2(buildCycleDateRange2(salaryMonth, salarySob.getAttendCycleType2(), salarySob.getAttendCycleEndDay()))
|
||||
.build();
|
||||
|
||||
salarySobCycleDTO.setSalaryDate(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth(), 1));
|
||||
|
|
@ -106,4 +107,27 @@ public class SalarySobCycleBO {
|
|||
.endDate(Date.from(endInstant))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 定制考勤周期,指定考勤周期的结束日期
|
||||
* 根据薪资所属月、薪资账套所设置的薪资周期(或考勤周期)、薪资周期起始日(活考勤周期起始日)计算出薪资账套的薪资周期、考勤周期的具体日期范围
|
||||
*
|
||||
* @param salaryMonth 薪资所属月
|
||||
* @param cycleType 薪资账套所设置的薪资周期(或考勤周期)
|
||||
* @param endDay 薪资账套所设置的薪资周期结束日期
|
||||
* @return
|
||||
*/
|
||||
private static LocalDateRange buildCycleDateRange2(YearMonth salaryMonth, Integer cycleType, Integer endDay) {
|
||||
YearMonth result = buildCycle(salaryMonth, cycleType);
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
LocalDate fromDate = result.atDay(1);
|
||||
LocalDate endDate = result.atDay(endDay);
|
||||
|
||||
return LocalDateRange.builder()
|
||||
.fromDate(SalaryDateUtil.localDateToDate(fromDate))
|
||||
.endDate(SalaryDateUtil.localDateToDate(endDate))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,23 @@ public class SalarySobBasicFormDTO {
|
|||
//考勤周期起始日期")
|
||||
private Integer attendCycleFromDay;
|
||||
|
||||
|
||||
/**
|
||||
* 定制考勤周期2
|
||||
* @see SalaryCycleTypeEnum
|
||||
*/
|
||||
private Integer attendCycleType2;
|
||||
|
||||
/**
|
||||
* 定制考勤周期,指定考勤周期的结束日期
|
||||
*/
|
||||
private Integer attendCycleEndDay;
|
||||
|
||||
/**
|
||||
* 采用哪个考勤周期,0正常,1定制
|
||||
*/
|
||||
private Integer attendType;
|
||||
|
||||
/**
|
||||
* 福利台账月份
|
||||
* @see SalaryCycleTypeEnum
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public class SalarySobCycleDTO {
|
|||
//考勤周期")
|
||||
private LocalDateRange attendCycle;
|
||||
|
||||
private LocalDateRange attendCycle2;
|
||||
|
||||
|
||||
/**
|
||||
* 公式变量
|
||||
|
|
|
|||
|
|
@ -83,6 +83,21 @@ public class SalarySobBasicSaveParam {
|
|||
@DataCheck(require = true, message = "考勤周期起始日期不允许为空")
|
||||
private Integer attendCycleFromDay;
|
||||
|
||||
/**
|
||||
* 定制考勤周期。1:上上月、2:上月、3:本月、4:下月
|
||||
*/
|
||||
private Integer attendCycleType2;
|
||||
|
||||
/**
|
||||
* 定制考勤周期,指定考勤周期的结束日期
|
||||
*/
|
||||
private Integer attendCycleEndDay;
|
||||
|
||||
/**
|
||||
* 采用哪个考勤周期,0正常,1定制
|
||||
*/
|
||||
private Integer attendType;
|
||||
|
||||
/**
|
||||
* 福利台账月份不允许为空
|
||||
*
|
||||
|
|
|
|||
|
|
@ -106,6 +106,21 @@ public class SalarySobPO {
|
|||
@XStreamAsAttribute
|
||||
private Integer attendCycleFromDay;
|
||||
|
||||
/**
|
||||
* 考勤周期2。1:上上月、2:上月、3:本月、4:下月
|
||||
*/
|
||||
private Integer attendCycleType2;
|
||||
|
||||
/**
|
||||
* 定制考勤周期,指定考勤周期的结束日期
|
||||
*/
|
||||
private Integer attendCycleEndDay;
|
||||
|
||||
/**
|
||||
* 采用哪个考勤周期,0正常,1定制
|
||||
*/
|
||||
private Integer attendType;
|
||||
|
||||
/**
|
||||
* 社保福利所属期。1:上上月、2:上月、3:本月、4:下月
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="tax_agent_id" property="taxAgentId"/>
|
||||
<result column="attend_cycle_type2" property="attendCycleType2"/>
|
||||
<result column="attend_cycle_end_day" property="attendCycleEndDay"/>
|
||||
<result column="attend_type" property="attendType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -42,6 +45,9 @@
|
|||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.tax_agent_id
|
||||
, t.attend_cycle_type2
|
||||
, t.attend_cycle_end_day
|
||||
, t.attend_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -162,6 +168,15 @@
|
|||
<if test="attendCycleFromDay != null">
|
||||
attend_cycle_from_day,
|
||||
</if>
|
||||
<if test="attendCycleType2 != null">
|
||||
attend_cycle_type2,
|
||||
</if>
|
||||
<if test="attendCycleEndDay != null">
|
||||
attend_cycle_end_day,
|
||||
</if>
|
||||
<if test="attendType != null">
|
||||
attend_type,
|
||||
</if>
|
||||
<if test="socialSecurityCycleType != null">
|
||||
social_security_cycle_type,
|
||||
</if>
|
||||
|
|
@ -215,6 +230,15 @@
|
|||
<if test="attendCycleFromDay != null">
|
||||
#{attendCycleFromDay},
|
||||
</if>
|
||||
<if test="attendCycleType2 != null">
|
||||
#{attendCycleType2},
|
||||
</if>
|
||||
<if test="attendCycleEndDay != null">
|
||||
#{attendCycleEndDay},
|
||||
</if>
|
||||
<if test="attendType != null">
|
||||
#{attendType},
|
||||
</if>
|
||||
<if test="socialSecurityCycleType != null">
|
||||
#{socialSecurityCycleType},
|
||||
</if>
|
||||
|
|
@ -279,6 +303,15 @@
|
|||
<if test="attendCycleFromDay != null">
|
||||
attend_cycle_from_day,
|
||||
</if>
|
||||
<if test="attendCycleType2 != null">
|
||||
attend_cycle_type2,
|
||||
</if>
|
||||
<if test="attendCycleEndDay != null">
|
||||
attend_cycle_end_day,
|
||||
</if>
|
||||
<if test="attendType != null">
|
||||
attend_type,
|
||||
</if>
|
||||
<if test="socialSecurityCycleType != null">
|
||||
social_security_cycle_type,
|
||||
</if>
|
||||
|
|
@ -332,6 +365,15 @@
|
|||
<if test="attendCycleFromDay != null">
|
||||
#{attendCycleFromDay},
|
||||
</if>
|
||||
<if test="attendCycleType2 != null">
|
||||
#{attendCycleType2},
|
||||
</if>
|
||||
<if test="attendCycleEndDay != null">
|
||||
#{attendCycleEndDay},
|
||||
</if>
|
||||
<if test="attendType != null">
|
||||
#{attendType},
|
||||
</if>
|
||||
<if test="socialSecurityCycleType != null">
|
||||
#{socialSecurityCycleType},
|
||||
</if>
|
||||
|
|
@ -373,6 +415,9 @@
|
|||
tax_cycle_type=#{taxCycleType},
|
||||
attend_cycle_type=#{attendCycleType},
|
||||
attend_cycle_from_day=#{attendCycleFromDay},
|
||||
attend_cycle_type2=#{attendCycleType2},
|
||||
attend_cycle_end_day=#{attendCycleEndDay},
|
||||
attend_type=#{attendType},
|
||||
social_security_cycle_type=#{socialSecurityCycleType},
|
||||
disable=#{disable},
|
||||
description=#{description},
|
||||
|
|
@ -411,6 +456,15 @@
|
|||
<if test="attendCycleFromDay != null">
|
||||
attend_cycle_from_day=#{attendCycleFromDay},
|
||||
</if>
|
||||
<if test="attendCycleType2 != null">
|
||||
attend_cycle_type2=#{attendCycleType2},
|
||||
</if>
|
||||
<if test="attendCycleEndDay != null">
|
||||
attend_cycle_end_day=#{attendCycleEndDay},
|
||||
</if>
|
||||
<if test="attendType != null">
|
||||
attend_type=#{attendType},
|
||||
</if>
|
||||
<if test="socialSecurityCycleType != null">
|
||||
social_security_cycle_type=#{socialSecurityCycleType},
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -390,7 +390,13 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
|
||||
|
||||
// 4.获取考勤模块数据
|
||||
List<Map<String, Object>> attendQuoteSyncData = getAttendQuoteDataFromRemoteAttend(salarySobCycleDTO.getAttendCycle(), employeeIds, attendQuoteFields);
|
||||
LocalDateRange attendCycle;
|
||||
if (salarySobPO.getAttendType() == 0) {
|
||||
attendCycle = salarySobCycleDTO.getAttendCycle();
|
||||
} else {
|
||||
attendCycle = salarySobCycleDTO.getAttendCycle2();
|
||||
}
|
||||
List<Map<String, Object>> attendQuoteSyncData = getAttendQuoteDataFromRemoteAttend(attendCycle, employeeIds, attendQuoteFields);
|
||||
List<AttendQuoteDataPO> pos = new ArrayList<>();
|
||||
List<AttendQuoteDataValuePO> values = new ArrayList<>();
|
||||
// 5.考勤引用数据处理
|
||||
|
|
@ -398,7 +404,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
if (CollectionUtils.isNotEmpty(attendQuoteSyncData)) {
|
||||
|
||||
// 3.生成考勤引用
|
||||
AttendQuotePO attendQuote = getAttendQuote(AttendQuoteSourceTypeEnum.QUOTE, salarySobId, year, month, syncParam.getDescription());
|
||||
AttendQuotePO attendQuote = getAttendQuote(AttendQuoteSourceTypeEnum.QUOTE, salarySobId, year, month, syncParam.getDescription(), attendCycle);
|
||||
|
||||
for (Long employeeId : employeeIds) {
|
||||
AttendQuoteDataPO po = new AttendQuoteDataPO();
|
||||
|
|
@ -471,7 +477,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
* @param month
|
||||
* @return
|
||||
*/
|
||||
private AttendQuotePO getAttendQuote(AttendQuoteSourceTypeEnum sourceType, Long salarySobId, int year, int month, String description) {
|
||||
private AttendQuotePO getAttendQuote(AttendQuoteSourceTypeEnum sourceType, Long salarySobId, int year, int month, String description, LocalDateRange attendCycle) {
|
||||
SalarySobCycleDTO salarySobCycle = getSalarySobService(user).getSalarySobCycle(salarySobId, YearMonth.of(year, month));
|
||||
|
||||
Date salaryYearMonthDayDate = SalaryDateUtil.localDateToDate(YearMonth.of(year, month).atDay(1));
|
||||
|
|
@ -485,7 +491,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
LocalDateRange salaryCycleRange = salarySobCycle.getSalaryCycle();
|
||||
LocalDateRange attendCycleRange = salarySobCycle.getAttendCycle();
|
||||
// 考勤周期
|
||||
attendQuote.setAttendCycle(SalaryDateUtil.getFormatLocalDate(attendCycleRange.getFromDate()) + " ~ " + SalaryDateUtil.getFormatLocalDate(attendCycleRange.getEndDate()));
|
||||
attendQuote.setAttendCycle(SalaryDateUtil.getFormatLocalDate(attendCycle.getFromDate()) + " ~ " + SalaryDateUtil.getFormatLocalDate(attendCycle.getEndDate()));
|
||||
// 薪资周期
|
||||
attendQuote.setSalaryCycle(SalaryDateUtil.getFormatLocalDate(salaryCycleRange.getFromDate()) + " ~ " + SalaryDateUtil.getFormatLocalDate(salaryCycleRange.getEndDate()));
|
||||
attendQuote.setSalaryYearMonth(salaryYearMonthDayDate);
|
||||
|
|
@ -686,8 +692,16 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||
// 获取已设置的可同步的考勤字段
|
||||
List<AttendQuoteFieldPO> attendQuoteFields = getAttendQuoteSetFields(AttendQuoteSourceTypeEnum.IMPORT);
|
||||
// 获取薪资账套
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(salarySobId, YearMonth.of(year, month));
|
||||
LocalDateRange attendCycle;
|
||||
if (salarySobPO.getAttendType() == 0) {
|
||||
attendCycle = salarySobCycleDTO.getAttendCycle();
|
||||
} else {
|
||||
attendCycle = salarySobCycleDTO.getAttendCycle2();
|
||||
}
|
||||
// 生成获取考勤引用
|
||||
AttendQuotePO attendQuote = getAttendQuote(AttendQuoteSourceTypeEnum.IMPORT, salarySobId, year, month, StringUtils.EMPTY);
|
||||
AttendQuotePO attendQuote = getAttendQuote(AttendQuoteSourceTypeEnum.IMPORT, salarySobId, year, month, StringUtils.EMPTY, attendCycle);
|
||||
|
||||
int total = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -565,6 +565,9 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
.setTaxCycleType(saveParam.getTaxCycleType())
|
||||
.setAttendCycleType(saveParam.getAttendCycleType())
|
||||
.setAttendCycleFromDay(saveParam.getAttendCycleFromDay())
|
||||
.setAttendCycleType2(saveParam.getAttendCycleType2())
|
||||
.setAttendCycleEndDay(saveParam.getAttendCycleEndDay())
|
||||
.setAttendType(saveParam.getAttendType())
|
||||
.setSocialSecurityCycleType(saveParam.getSocialSecurityCycleType())
|
||||
.setDescription(saveParam.getDescription())
|
||||
.setUpdateTime(new Date());
|
||||
|
|
@ -731,6 +734,9 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
.taxCycleType(salarySobPO.getTaxCycleType())
|
||||
.attendCycleType(salarySobPO.getAttendCycleType())
|
||||
.attendCycleFromDay(salarySobPO.getAttendCycleFromDay())
|
||||
.attendCycleType2(salarySobPO.getAttendCycleType2())
|
||||
.attendCycleEndDay(salarySobPO.getAttendCycleEndDay())
|
||||
.attendType(salarySobPO.getAttendType())
|
||||
.socialSecurityCycleType(salarySobPO.getSocialSecurityCycleType())
|
||||
.disable(salarySobPO.getDisable())
|
||||
.creator((long) user.getUID())
|
||||
|
|
|
|||
Loading…
Reference in New Issue