From 8b87468c4f6323d9be80af3e5cac514ecc9b3daa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com>
Date: Thu, 19 Dec 2024 16:37:36 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E5=88=B6-=E5=85=89=E9=98=B3=EF=BC=8C?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=80=83=E5=8B=A4=E5=91=A8=E6=9C=9F=E8=A7=84?=
=?UTF-8?q?=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Mysql/sql202412190103CZGYMTCYXGS.sql | 11 ++++
.../SQLServer/sql202412190103CZGYMTCYXGS.sql | 11 ++++
.../entity/salarysob/bo/SalarySobBO.java | 6 +++
.../entity/salarysob/bo/SalarySobCycleBO.java | 24 +++++++++
.../salarysob/dto/SalarySobBasicFormDTO.java | 17 ++++++
.../salarysob/dto/SalarySobCycleDTO.java | 2 +
.../param/SalarySobBasicSaveParam.java | 15 ++++++
.../entity/salarysob/po/SalarySobPO.java | 15 ++++++
.../mapper/salarysob/SalarySobMapper.xml | 54 +++++++++++++++++++
.../impl/AttendQuoteDataServiceImpl.java | 24 +++++++--
.../service/impl/SalarySobServiceImpl.java | 6 +++
11 files changed, 180 insertions(+), 5 deletions(-)
create mode 100644 resource/sqlupgrade/Mysql/sql202412190103CZGYMTCYXGS.sql
create mode 100644 resource/sqlupgrade/SQLServer/sql202412190103CZGYMTCYXGS.sql
diff --git a/resource/sqlupgrade/Mysql/sql202412190103CZGYMTCYXGS.sql b/resource/sqlupgrade/Mysql/sql202412190103CZGYMTCYXGS.sql
new file mode 100644
index 000000000..e10b1401c
--- /dev/null
+++ b/resource/sqlupgrade/Mysql/sql202412190103CZGYMTCYXGS.sql
@@ -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
+;
\ No newline at end of file
diff --git a/resource/sqlupgrade/SQLServer/sql202412190103CZGYMTCYXGS.sql b/resource/sqlupgrade/SQLServer/sql202412190103CZGYMTCYXGS.sql
new file mode 100644
index 000000000..5eda0cef4
--- /dev/null
+++ b/resource/sqlupgrade/SQLServer/sql202412190103CZGYMTCYXGS.sql
@@ -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
\ No newline at end of file
diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobBO.java
index e84a890ee..04aecb256 100644
--- a/src/com/engine/salary/entity/salarysob/bo/SalarySobBO.java
+++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobBO.java
@@ -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());
diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobCycleBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobCycleBO.java
index 37a505a31..dcfa831ff 100644
--- a/src/com/engine/salary/entity/salarysob/bo/SalarySobCycleBO.java
+++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobCycleBO.java
@@ -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();
+ }
}
diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobBasicFormDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobBasicFormDTO.java
index 131668372..570844192 100644
--- a/src/com/engine/salary/entity/salarysob/dto/SalarySobBasicFormDTO.java
+++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobBasicFormDTO.java
@@ -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
diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java
index 70a688b10..19a125496 100644
--- a/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java
+++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobCycleDTO.java
@@ -47,6 +47,8 @@ public class SalarySobCycleDTO {
//考勤周期")
private LocalDateRange attendCycle;
+ private LocalDateRange attendCycle2;
+
/**
* 公式变量
diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java
index bd86de4d6..3d8858134 100644
--- a/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java
+++ b/src/com/engine/salary/entity/salarysob/param/SalarySobBasicSaveParam.java
@@ -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;
+
/**
* 福利台账月份不允许为空
*
diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java
index 231d6f866..0d163673c 100644
--- a/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java
+++ b/src/com/engine/salary/entity/salarysob/po/SalarySobPO.java
@@ -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:下月
*/
diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobMapper.xml
index 59f40120d..395f593be 100644
--- a/src/com/engine/salary/mapper/salarysob/SalarySobMapper.xml
+++ b/src/com/engine/salary/mapper/salarysob/SalarySobMapper.xml
@@ -19,6 +19,9 @@
+
+
+
@@ -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
@@ -162,6 +168,15 @@
attend_cycle_from_day,
+
+ attend_cycle_type2,
+
+
+ attend_cycle_end_day,
+
+
+ attend_type,
+
social_security_cycle_type,
@@ -215,6 +230,15 @@
#{attendCycleFromDay},
+
+ #{attendCycleType2},
+
+
+ #{attendCycleEndDay},
+
+
+ #{attendType},
+
#{socialSecurityCycleType},
@@ -279,6 +303,15 @@
attend_cycle_from_day,
+
+ attend_cycle_type2,
+
+
+ attend_cycle_end_day,
+
+
+ attend_type,
+
social_security_cycle_type,
@@ -332,6 +365,15 @@
#{attendCycleFromDay},
+
+ #{attendCycleType2},
+
+
+ #{attendCycleEndDay},
+
+
+ #{attendType},
+
#{socialSecurityCycleType},
@@ -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 @@
attend_cycle_from_day=#{attendCycleFromDay},
+
+ attend_cycle_type2=#{attendCycleType2},
+
+
+ attend_cycle_end_day=#{attendCycleEndDay},
+
+
+ attend_type=#{attendType},
+
social_security_cycle_type=#{socialSecurityCycleType},
diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java
index 48648cc57..a8203f848 100644
--- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java
+++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java
@@ -390,7 +390,13 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
// 4.获取考勤模块数据
- List