Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 37aaebe5
authored
Jan 14, 2026
by
zhoulm
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工资计算
1 parent
90588a35
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
640 additions
and
798 deletions
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/dto/salary/StaffMonthSalarySlipDTO.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthBusinessData.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthSalarySlip.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemote.java
rpc-dj-staff/pom.xml
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/config/dubbo/SmartCarLifeDubboConfig.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/constant/CommonConstants.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthBusinessDataMapper.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthSalarySlipMapper.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemoteImpl.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthBusinessDataService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthSalarySlipService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/util/CommonUtil.java
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthBusinessDataMapper.xml
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthSalarySlipMapper.xml
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/dto/salary/StaffMonthSalarySlipDTO.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
dto
.
salary
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
lombok.experimental.SuperBuilder
;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
public
class
StaffMonthSalarySlipDTO
extends
StaffMonthSalarySlip
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
4482729958297967553L
;
@ApiModelProperty
(
notes
=
"员工手机号列表"
)
private
List
<
String
>
staffPhones
;
@ApiModelProperty
(
notes
=
"月份列表(格式:yyyy-MM)"
)
private
List
<
String
>
salaryMonthList
;
@ApiModelProperty
(
notes
=
"工资月份-开始"
)
private
String
salaryMonthBegin
;
@ApiModelProperty
(
notes
=
"工资月份-结束"
)
private
String
salaryMonthEnd
;
private
BigDecimal
totalActualSalary
;
}
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthBusinessData.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
model
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
model
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.*
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
lombok.experimental.SuperBuilder
;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
@Table
(
name
=
"dj_car_life_staff_month_business_data"
)
@Table
(
name
=
"dj_car_life_staff_month_business_data"
)
public
class
StaffMonthBusinessData
{
public
class
StaffMonthBusinessData
implements
Serializable
{
/**
/**
*
*/
private
static
final
long
serialVersionUID
=
9037646833505966717L
;
/**
* 主键ID
* 主键ID
*/
*/
@Id
@Id
...
@@ -26,10 +47,10 @@ public class StaffMonthBusinessData {
...
@@ -26,10 +47,10 @@ public class StaffMonthBusinessData {
private
String
salaryMonth
;
private
String
salaryMonth
;
/**
/**
* 业务场景类型
* 业务场景类型
(0:轻改,1:权益;2:延保)
*/
*/
@Column
(
name
=
"business_type"
)
@Column
(
name
=
"business_type"
)
private
String
businessType
;
private
Byte
businessType
;
/**
/**
* 产值
* 产值
...
@@ -72,202 +93,4 @@ public class StaffMonthBusinessData {
...
@@ -72,202 +93,4 @@ public class StaffMonthBusinessData {
*/
*/
@Column
(
name
=
"deleted_flag"
)
@Column
(
name
=
"deleted_flag"
)
private
String
deletedFlag
;
private
String
deletedFlag
;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取驻店员工手机号
*
* @return staff_phone - 驻店员工手机号
*/
public
String
getStaffPhone
()
{
return
staffPhone
;
}
/**
* 设置驻店员工手机号
*
* @param staffPhone 驻店员工手机号
*/
public
void
setStaffPhone
(
String
staffPhone
)
{
this
.
staffPhone
=
staffPhone
==
null
?
null
:
staffPhone
.
trim
();
}
/**
* 获取工资月份
*
* @return salary_month - 工资月份
*/
public
String
getSalaryMonth
()
{
return
salaryMonth
;
}
/**
* 设置工资月份
*
* @param salaryMonth 工资月份
*/
public
void
setSalaryMonth
(
String
salaryMonth
)
{
this
.
salaryMonth
=
salaryMonth
==
null
?
null
:
salaryMonth
.
trim
();
}
/**
* 获取业务场景类型
*
* @return business_type - 业务场景类型
*/
public
String
getBusinessType
()
{
return
businessType
;
}
/**
* 设置业务场景类型
*
* @param businessType 业务场景类型
*/
public
void
setBusinessType
(
String
businessType
)
{
this
.
businessType
=
businessType
==
null
?
null
:
businessType
.
trim
();
}
/**
* 获取产值
*
* @return order_total_price - 产值
*/
public
BigDecimal
getOrderTotalPrice
()
{
return
orderTotalPrice
;
}
/**
* 设置产值
*
* @param orderTotalPrice 产值
*/
public
void
setOrderTotalPrice
(
BigDecimal
orderTotalPrice
)
{
this
.
orderTotalPrice
=
orderTotalPrice
;
}
/**
* 获取提成
*
* @return commission_price - 提成
*/
public
BigDecimal
getCommissionPrice
()
{
return
commissionPrice
;
}
/**
* 设置提成
*
* @param commissionPrice 提成
*/
public
void
setCommissionPrice
(
BigDecimal
commissionPrice
)
{
this
.
commissionPrice
=
commissionPrice
;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public
String
getCreatedBy
()
{
return
createdBy
;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
==
null
?
null
:
createdBy
.
trim
();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public
Date
getCreatedDate
()
{
return
createdDate
;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public
void
setCreatedDate
(
Date
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public
String
getUpdatedBy
()
{
return
updatedBy
;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public
void
setUpdatedBy
(
String
updatedBy
)
{
this
.
updatedBy
=
updatedBy
==
null
?
null
:
updatedBy
.
trim
();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public
Date
getUpdatedDate
()
{
return
updatedDate
;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public
void
setUpdatedDate
(
Date
updatedDate
)
{
this
.
updatedDate
=
updatedDate
;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public
String
getDeletedFlag
()
{
return
deletedFlag
;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public
void
setDeletedFlag
(
String
deletedFlag
)
{
this
.
deletedFlag
=
deletedFlag
==
null
?
null
:
deletedFlag
.
trim
();
}
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthSalarySlip.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
model
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
model
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
lombok.experimental.SuperBuilder
;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
@Table
(
name
=
"dj_car_life_staff_month_salary_slip"
)
@Table
(
name
=
"dj_car_life_staff_month_salary_slip"
)
public
class
StaffMonthSalarySlip
{
public
class
StaffMonthSalarySlip
implements
Serializable
{
/**
/**
*
*/
private
static
final
long
serialVersionUID
=
4789440447598977456L
;
/**
* 主键ID
* 主键ID
*/
*/
@Id
@Id
...
@@ -96,7 +113,14 @@ public class StaffMonthSalarySlip {
...
@@ -96,7 +113,14 @@ public class StaffMonthSalarySlip {
*/
*/
@Column
(
name
=
"commission_price"
)
@Column
(
name
=
"commission_price"
)
private
BigDecimal
commissionPrice
;
private
BigDecimal
commissionPrice
;
/**
* 日报扣款次数
*/
@ApiModelProperty
(
notes
=
"日报扣款次数"
)
@Column
(
name
=
"daily_deduct_count"
)
private
Integer
dailyDeductCount
;
/**
/**
* 日报总扣款
* 日报总扣款
*/
*/
...
@@ -104,6 +128,13 @@ public class StaffMonthSalarySlip {
...
@@ -104,6 +128,13 @@ public class StaffMonthSalarySlip {
private
BigDecimal
dailyDeductMoney
;
private
BigDecimal
dailyDeductMoney
;
/**
/**
* 平板扣款次数
*/
@ApiModelProperty
(
notes
=
"平板扣款次数"
)
@Column
(
name
=
"pad_deduct_count"
)
private
Integer
padDeductCount
;
/**
* 平板总扣款
* 平板总扣款
*/
*/
@Column
(
name
=
"pad_deduct_money"
)
@Column
(
name
=
"pad_deduct_money"
)
...
@@ -140,17 +171,17 @@ public class StaffMonthSalarySlip {
...
@@ -140,17 +171,17 @@ public class StaffMonthSalarySlip {
private
BigDecimal
deferredRatio
;
private
BigDecimal
deferredRatio
;
/**
/**
* 退单冲减
*/
@Column
(
name
=
"refund_offset"
)
private
BigDecimal
refundOffset
;
/**
* 其他扣款
* 其他扣款
*/
*/
@Column
(
name
=
"other_deduction"
)
@Column
(
name
=
"other_deduction"
)
private
BigDecimal
otherDeduction
;
private
BigDecimal
otherDeduction
;
/**
* 其他扣款明细
*/
@Column
(
name
=
"other_deduction_detail"
)
private
String
otherDeductionDetail
;
/**
/**
* 其他奖励
* 其他奖励
*/
*/
...
@@ -158,6 +189,12 @@ public class StaffMonthSalarySlip {
...
@@ -158,6 +189,12 @@ public class StaffMonthSalarySlip {
private
BigDecimal
otherRewards
;
private
BigDecimal
otherRewards
;
/**
/**
* 其他奖励明细
*/
@Column
(
name
=
"other_rewards_detail"
)
private
String
otherRewardsDetail
;
/**
* 合计应发工资
* 合计应发工资
*/
*/
private
BigDecimal
salary
;
private
BigDecimal
salary
;
...
@@ -197,580 +234,4 @@ public class StaffMonthSalarySlip {
...
@@ -197,580 +234,4 @@ public class StaffMonthSalarySlip {
*/
*/
@Column
(
name
=
"deleted_flag"
)
@Column
(
name
=
"deleted_flag"
)
private
String
deletedFlag
;
private
String
deletedFlag
;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取驻店员工姓名
*
* @return staff_name - 驻店员工姓名
*/
public
String
getStaffName
()
{
return
staffName
;
}
/**
* 设置驻店员工姓名
*
* @param staffName 驻店员工姓名
*/
public
void
setStaffName
(
String
staffName
)
{
this
.
staffName
=
staffName
==
null
?
null
:
staffName
.
trim
();
}
/**
* 获取驻店员工手机号
*
* @return staff_phone - 驻店员工手机号
*/
public
String
getStaffPhone
()
{
return
staffPhone
;
}
/**
* 设置驻店员工手机号
*
* @param staffPhone 驻店员工手机号
*/
public
void
setStaffPhone
(
String
staffPhone
)
{
this
.
staffPhone
=
staffPhone
==
null
?
null
:
staffPhone
.
trim
();
}
/**
* 获取业务类型(0:轻改,1:权益;2:延保)多个逗号分隔
*
* @return business_types - 业务类型(0:轻改,1:权益;2:延保)多个逗号分隔
*/
public
String
getBusinessTypes
()
{
return
businessTypes
;
}
/**
* 设置业务类型(0:轻改,1:权益;2:延保)多个逗号分隔
*
* @param businessTypes 业务类型(0:轻改,1:权益;2:延保)多个逗号分隔
*/
public
void
setBusinessTypes
(
String
businessTypes
)
{
this
.
businessTypes
=
businessTypes
==
null
?
null
:
businessTypes
.
trim
();
}
/**
* 获取工资月份
*
* @return salary_month - 工资月份
*/
public
String
getSalaryMonth
()
{
return
salaryMonth
;
}
/**
* 设置工资月份
*
* @param salaryMonth 工资月份
*/
public
void
setSalaryMonth
(
String
salaryMonth
)
{
this
.
salaryMonth
=
salaryMonth
==
null
?
null
:
salaryMonth
.
trim
();
}
/**
* 获取是否最终数据(Y:是,N:否)
*
* @return final_data_flag - 是否最终数据(Y:是,N:否)
*/
public
String
getFinalDataFlag
()
{
return
finalDataFlag
;
}
/**
* 设置是否最终数据(Y:是,N:否)
*
* @param finalDataFlag 是否最终数据(Y:是,N:否)
*/
public
void
setFinalDataFlag
(
String
finalDataFlag
)
{
this
.
finalDataFlag
=
finalDataFlag
==
null
?
null
:
finalDataFlag
.
trim
();
}
/**
* 获取应出勤天数
*
* @return should_work_day - 应出勤天数
*/
public
BigDecimal
getShouldWorkDay
()
{
return
shouldWorkDay
;
}
/**
* 设置应出勤天数
*
* @param shouldWorkDay 应出勤天数
*/
public
void
setShouldWorkDay
(
BigDecimal
shouldWorkDay
)
{
this
.
shouldWorkDay
=
shouldWorkDay
;
}
/**
* 获取实际出勤天数
*
* @return actual_work_day - 实际出勤天数
*/
public
BigDecimal
getActualWorkDay
()
{
return
actualWorkDay
;
}
/**
* 设置实际出勤天数
*
* @param actualWorkDay 实际出勤天数
*/
public
void
setActualWorkDay
(
BigDecimal
actualWorkDay
)
{
this
.
actualWorkDay
=
actualWorkDay
;
}
/**
* 获取薪资标准
*
* @return salary_standard - 薪资标准
*/
public
BigDecimal
getSalaryStandard
()
{
return
salaryStandard
;
}
/**
* 设置薪资标准
*
* @param salaryStandard 薪资标准
*/
public
void
setSalaryStandard
(
BigDecimal
salaryStandard
)
{
this
.
salaryStandard
=
salaryStandard
;
}
/**
* 获取底薪
*
* @return minimum_salary - 底薪
*/
public
BigDecimal
getMinimumSalary
()
{
return
minimumSalary
;
}
/**
* 设置底薪
*
* @param minimumSalary 底薪
*/
public
void
setMinimumSalary
(
BigDecimal
minimumSalary
)
{
this
.
minimumSalary
=
minimumSalary
;
}
/**
* 获取绩效等级(1.S,2.A,3.B,4.B+,5.B-,6.C,7.D)
*
* @return performance_level - 绩效等级(1.S,2.A,3.B,4.B+,5.B-,6.C,7.D)
*/
public
Byte
getPerformanceLevel
()
{
return
performanceLevel
;
}
/**
* 设置绩效等级(1.S,2.A,3.B,4.B+,5.B-,6.C,7.D)
*
* @param performanceLevel 绩效等级(1.S,2.A,3.B,4.B+,5.B-,6.C,7.D)
*/
public
void
setPerformanceLevel
(
Byte
performanceLevel
)
{
this
.
performanceLevel
=
performanceLevel
;
}
/**
* 获取绩效工资
*
* @return performance_salary - 绩效工资
*/
public
BigDecimal
getPerformanceSalary
()
{
return
performanceSalary
;
}
/**
* 设置绩效工资
*
* @param performanceSalary 绩效工资
*/
public
void
setPerformanceSalary
(
BigDecimal
performanceSalary
)
{
this
.
performanceSalary
=
performanceSalary
;
}
/**
* 获取基本工资
*
* @return basic_salary - 基本工资
*/
public
BigDecimal
getBasicSalary
()
{
return
basicSalary
;
}
/**
* 设置基本工资
*
* @param basicSalary 基本工资
*/
public
void
setBasicSalary
(
BigDecimal
basicSalary
)
{
this
.
basicSalary
=
basicSalary
;
}
/**
* 获取总产值
*
* @return order_total_price - 总产值
*/
public
BigDecimal
getOrderTotalPrice
()
{
return
orderTotalPrice
;
}
/**
* 设置总产值
*
* @param orderTotalPrice 总产值
*/
public
void
setOrderTotalPrice
(
BigDecimal
orderTotalPrice
)
{
this
.
orderTotalPrice
=
orderTotalPrice
;
}
/**
* 获取总提成
*
* @return commission_price - 总提成
*/
public
BigDecimal
getCommissionPrice
()
{
return
commissionPrice
;
}
/**
* 设置总提成
*
* @param commissionPrice 总提成
*/
public
void
setCommissionPrice
(
BigDecimal
commissionPrice
)
{
this
.
commissionPrice
=
commissionPrice
;
}
/**
* 获取日报总扣款
*
* @return daily_deduct_money - 日报总扣款
*/
public
BigDecimal
getDailyDeductMoney
()
{
return
dailyDeductMoney
;
}
/**
* 设置日报总扣款
*
* @param dailyDeductMoney 日报总扣款
*/
public
void
setDailyDeductMoney
(
BigDecimal
dailyDeductMoney
)
{
this
.
dailyDeductMoney
=
dailyDeductMoney
;
}
/**
* 获取平板总扣款
*
* @return pad_deduct_money - 平板总扣款
*/
public
BigDecimal
getPadDeductMoney
()
{
return
padDeductMoney
;
}
/**
* 设置平板总扣款
*
* @param padDeductMoney 平板总扣款
*/
public
void
setPadDeductMoney
(
BigDecimal
padDeductMoney
)
{
this
.
padDeductMoney
=
padDeductMoney
;
}
/**
* 获取递延金支出
*
* @return defer_expenses - 递延金支出
*/
public
BigDecimal
getDeferExpenses
()
{
return
deferExpenses
;
}
/**
* 设置递延金支出
*
* @param deferExpenses 递延金支出
*/
public
void
setDeferExpenses
(
BigDecimal
deferExpenses
)
{
this
.
deferExpenses
=
deferExpenses
;
}
/**
* 获取递延金收入
*
* @return defer_income - 递延金收入
*/
public
BigDecimal
getDeferIncome
()
{
return
deferIncome
;
}
/**
* 设置递延金收入
*
* @param deferIncome 递延金收入
*/
public
void
setDeferIncome
(
BigDecimal
deferIncome
)
{
this
.
deferIncome
=
deferIncome
;
}
/**
* 获取日报扣款数额配置
*
* @return daily_deduction - 日报扣款数额配置
*/
public
BigDecimal
getDailyDeduction
()
{
return
dailyDeduction
;
}
/**
* 设置日报扣款数额配置
*
* @param dailyDeduction 日报扣款数额配置
*/
public
void
setDailyDeduction
(
BigDecimal
dailyDeduction
)
{
this
.
dailyDeduction
=
dailyDeduction
;
}
/**
* 获取平板扣款数额配置
*
* @return pad_deduction - 平板扣款数额配置
*/
public
BigDecimal
getPadDeduction
()
{
return
padDeduction
;
}
/**
* 设置平板扣款数额配置
*
* @param padDeduction 平板扣款数额配置
*/
public
void
setPadDeduction
(
BigDecimal
padDeduction
)
{
this
.
padDeduction
=
padDeduction
;
}
/**
* 获取递延金比例配置
*
* @return deferred_ratio - 递延金比例配置
*/
public
BigDecimal
getDeferredRatio
()
{
return
deferredRatio
;
}
/**
* 设置递延金比例配置
*
* @param deferredRatio 递延金比例配置
*/
public
void
setDeferredRatio
(
BigDecimal
deferredRatio
)
{
this
.
deferredRatio
=
deferredRatio
;
}
/**
* 获取退单冲减
*
* @return refund_offset - 退单冲减
*/
public
BigDecimal
getRefundOffset
()
{
return
refundOffset
;
}
/**
* 设置退单冲减
*
* @param refundOffset 退单冲减
*/
public
void
setRefundOffset
(
BigDecimal
refundOffset
)
{
this
.
refundOffset
=
refundOffset
;
}
/**
* 获取其他扣款
*
* @return other_deduction - 其他扣款
*/
public
BigDecimal
getOtherDeduction
()
{
return
otherDeduction
;
}
/**
* 设置其他扣款
*
* @param otherDeduction 其他扣款
*/
public
void
setOtherDeduction
(
BigDecimal
otherDeduction
)
{
this
.
otherDeduction
=
otherDeduction
;
}
/**
* 获取其他奖励
*
* @return other_rewards - 其他奖励
*/
public
BigDecimal
getOtherRewards
()
{
return
otherRewards
;
}
/**
* 设置其他奖励
*
* @param otherRewards 其他奖励
*/
public
void
setOtherRewards
(
BigDecimal
otherRewards
)
{
this
.
otherRewards
=
otherRewards
;
}
/**
* 获取合计应发工资
*
* @return salary - 合计应发工资
*/
public
BigDecimal
getSalary
()
{
return
salary
;
}
/**
* 设置合计应发工资
*
* @param salary 合计应发工资
*/
public
void
setSalary
(
BigDecimal
salary
)
{
this
.
salary
=
salary
;
}
/**
* 获取纠正后工资
*
* @return correct_salary - 纠正后工资
*/
public
BigDecimal
getCorrectSalary
()
{
return
correctSalary
;
}
/**
* 设置纠正后工资
*
* @param correctSalary 纠正后工资
*/
public
void
setCorrectSalary
(
BigDecimal
correctSalary
)
{
this
.
correctSalary
=
correctSalary
;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public
String
getCreatedBy
()
{
return
createdBy
;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
==
null
?
null
:
createdBy
.
trim
();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public
Date
getCreatedDate
()
{
return
createdDate
;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public
void
setCreatedDate
(
Date
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public
String
getUpdatedBy
()
{
return
updatedBy
;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public
void
setUpdatedBy
(
String
updatedBy
)
{
this
.
updatedBy
=
updatedBy
==
null
?
null
:
updatedBy
.
trim
();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public
Date
getUpdatedDate
()
{
return
updatedDate
;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public
void
setUpdatedDate
(
Date
updatedDate
)
{
this
.
updatedDate
=
updatedDate
;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public
String
getDeletedFlag
()
{
return
deletedFlag
;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public
void
setDeletedFlag
(
String
deletedFlag
)
{
this
.
deletedFlag
=
deletedFlag
==
null
?
null
:
deletedFlag
.
trim
();
}
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemote.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
remote
.
salary
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiParam
;
import
cn.com.glsx.framework.core.annotation.ApiParams
;
import
cn.com.glsx.framework.core.annotation.ApiResponse
;
import
cn.com.glsx.framework.core.annotation.ApiService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
@ApiService
(
value
=
"员工工资接口"
,
owner
=
"zhoulm"
,
protocol
=
ApiService
.
ProtocolEnum
.
dubbo
,
version
=
"1.0.0"
)
public
interface
StaffMonthSalarySlipRemote
{
@ApiMethod
(
"分页查询员工月度工资"
)
@ApiParam
(
name
=
"pagination"
,
notes
=
"分页查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"分页查询结果"
)
RpcResponse
<
RpcPagination
<
StaffMonthSalarySlipDTO
>>
pageStaffMonthSalary
(
@NotNull
RpcPagination
<
StaffMonthSalarySlipDTO
>
pagination
);
@ApiMethod
(
"统计员工月度工资"
)
@ApiParam
(
name
=
"dto"
,
notes
=
"查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"统计结果"
)
RpcResponse
<
StaffMonthSalarySlipDTO
>
statStaffMonthSalary
(
@NotNull
StaffMonthSalarySlipDTO
dto
);
@ApiMethod
(
"查询员工月度工资"
)
@ApiParams
({
@ApiParam
(
name
=
"staffPhone"
,
notes
=
"手机号"
,
dataType
=
ApiParam
.
DataTypeEnum
.
STRING
,
required
=
true
),
@ApiParam
(
name
=
"salaryMonth"
,
notes
=
"工资月份"
,
dataType
=
ApiParam
.
DataTypeEnum
.
STRING
,
required
=
true
)
})
@ApiResponse
(
"员工月度工资"
)
RpcResponse
<
StaffMonthSalarySlip
>
getStaffSalary
(
@NotBlank
String
staffPhone
,
@NotBlank
String
salaryMonth
);
}
rpc-dj-staff/pom.xml
View file @
37aaebe
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<version>
5.
3
.0-SNAPSHOT
</version>
<version>
5.
6
.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.com.glsx.entmicro
</groupId>
<groupId>
cn.com.glsx.entmicro
</groupId>
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/config/dubbo/SmartCarLifeDubboConfig.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
config
.
dubbo
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
config
.
dubbo
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffBehaviorDeductMoneyRecordRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.staff.config.DubboConfig
;
import
cn.com.glsx.dj.staff.config.DubboConfig
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Configuration
public
class
SmartCarLifeDubboConfig
extends
DubboConfig
{
public
class
SmartCarLifeDubboConfig
extends
DubboConfig
{
...
@@ -19,4 +23,19 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
...
@@ -19,4 +23,19 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
return
factory
.
builder
(
MerchantDailyReportHuaweiRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
return
factory
.
builder
(
MerchantDailyReportHuaweiRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
}
@Bean
public
StaffBaseInfoRemote
staffBaseInfoRemote
()
{
return
factory
.
builder
(
StaffBaseInfoRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
@Bean
public
GoodsOrderRemote
goodsOrderRemote
()
{
return
factory
.
builder
(
GoodsOrderRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
build
();
}
@Bean
public
StaffBehaviorDeductMoneyRecordRemote
staffBehaviorDeductMoneyRecordRemote
()
{
return
factory
.
builder
(
StaffBehaviorDeductMoneyRecordRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/constant/CommonConstants.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
constant
;
import
java.math.BigDecimal
;
public
class
CommonConstants
{
public
static
final
String
DEFAULT_UPDATE_BY
=
"system"
;
public
static
final
BigDecimal
ONEHUNDRED_BIGDECIMAL
=
BigDecimal
.
valueOf
(
100
);
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthBusinessDataMapper.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
@Mapper
public
interface
StaffMonthBusinessDataMapper
extends
OreMapper
<
StaffMonthBusinessData
>
{
public
interface
StaffMonthBusinessDataMapper
extends
OreMapper
<
StaffMonthBusinessData
>
{
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthSalarySlipMapper.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
@Mapper
public
interface
StaffMonthSalarySlipMapper
extends
OreMapper
<
StaffMonthSalarySlip
>
{
public
interface
StaffMonthSalarySlipMapper
extends
OreMapper
<
StaffMonthSalarySlip
>
{
List
<
StaffMonthSalarySlipDTO
>
list
(
StaffMonthSalarySlipDTO
condition
);
StaffMonthSalarySlipDTO
statStaffMonthSalary
(
StaffMonthSalarySlipDTO
dto
);
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemoteImpl.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
remote
.
salary
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.dj.staff.service.salary.StaffMonthSalarySlipService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
@DubboService
(
version
=
"1.0.0"
,
validation
=
"true"
)
public
class
StaffMonthSalarySlipRemoteImpl
implements
StaffMonthSalarySlipRemote
{
@Autowired
private
StaffMonthSalarySlipService
staffMonthSalarySlipService
;
@Override
public
RpcResponse
<
RpcPagination
<
StaffMonthSalarySlipDTO
>>
pageStaffMonthSalary
(
@NotNull
RpcPagination
<
StaffMonthSalarySlipDTO
>
pagination
)
{
try
{
pagination
=
RpcPagination
.
copyPage
(
staffMonthSalarySlipService
.
pageStaffMonthSalary
(
pagination
));
return
RpcResponse
.
success
(
pagination
);
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
@Override
public
RpcResponse
<
StaffMonthSalarySlipDTO
>
statStaffMonthSalary
(
@NotNull
StaffMonthSalarySlipDTO
dto
)
{
try
{
return
RpcResponse
.
success
(
staffMonthSalarySlipService
.
statStaffMonthSalary
(
dto
));
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
@Override
public
RpcResponse
<
StaffMonthSalarySlip
>
getStaffSalary
(
@NotBlank
String
staffPhone
,
@NotBlank
String
salaryMonth
)
{
try
{
return
RpcResponse
.
success
(
staffMonthSalarySlipService
.
get
(
staffPhone
,
salaryMonth
));
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthBusinessDataService.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
.
salary
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
org.oreframework.boot.env.OrePropertyConfigurer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
cn.com.glsx.dj.smartcarlife.dto.GoodsOrderDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.OrderCountDTO
;
import
cn.com.glsx.dj.smartcarlife.enums.BusinessTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.OrderStatus
;
import
cn.com.glsx.dj.smartcarlife.enums.OrderBusinessTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.util.DateUtils
;
import
cn.com.glsx.dj.staff.constant.CommonConstants
;
import
cn.com.glsx.dj.staff.mapper.StaffMonthBusinessDataMapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
cn.com.glsx.dj.staff.util.CommonUtil
;
import
cn.com.glsx.framework.core.beans.BaseModel
;
import
cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.util.RpcAssert
;
import
lombok.extern.slf4j.Slf4j
;
import
tk.mybatis.mapper.entity.Example
;
@Slf4j
@Service
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
rollbackFor
=
RpcServiceException
.
class
)
public
class
StaffMonthBusinessDataService
{
@Lazy
@Autowired
private
StaffMonthBusinessDataService
thiz
;
@Autowired
private
StaffMonthBusinessDataMapper
staffMonthBusinessDataMapper
;
@Autowired
private
GoodsOrderRemote
goodsOrderRemote
;
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
List
<
StaffMonthBusinessData
>
updateStaffMonthBusinessData
(
String
staffPhone
,
String
salaryMonth
)
{
RpcAssert
.
assertNotEmpty
(
staffPhone
,
DefaultErrorEnum
.
DATA_NULL
,
"staffPhone not be null"
);
RpcAssert
.
assertNotEmpty
(
salaryMonth
,
DefaultErrorEnum
.
DATA_NULL
,
"salaryMonth not be null"
);
try
{
StaffMonthBusinessData
staffMonthBusinessData
=
new
StaffMonthBusinessData
();
staffMonthBusinessData
.
setDeletedFlag
(
BaseModel
.
DeletedFlagEnum
.
D
.
name
());
staffMonthBusinessData
.
setUpdatedDate
(
new
Date
());
Example
example
=
new
Example
(
StaffMonthBusinessData
.
class
);
example
.
createCriteria
().
andEqualTo
(
"staffPhone"
,
staffPhone
)
.
andEqualTo
(
"salaryMonth"
,
salaryMonth
)
.
andEqualTo
(
"deletedFlag"
,
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
staffMonthBusinessDataMapper
.
updateByExampleSelective
(
staffMonthBusinessData
,
example
);
List
<
StaffMonthBusinessData
>
list
=
new
ArrayList
<>();
list
.
add
(
thiz
.
init
(
staffPhone
,
salaryMonth
,
OrderBusinessTypeEnum
.
LIGHTLY_MODIFY
));
list
.
add
(
thiz
.
init
(
staffPhone
,
salaryMonth
,
OrderBusinessTypeEnum
.
EQUITY
));
list
.
add
(
thiz
.
init
(
staffPhone
,
salaryMonth
,
OrderBusinessTypeEnum
.
EXTENDED_WARRANTY
));
staffMonthBusinessDataMapper
.
insertList
(
list
);
return
list
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
public
StaffMonthBusinessData
init
(
String
staffPhone
,
String
salaryMonth
,
OrderBusinessTypeEnum
businessType
)
{
RpcAssert
.
assertNotEmpty
(
staffPhone
,
DefaultErrorEnum
.
DATA_NULL
,
"staffPhone not be null"
);
RpcAssert
.
assertNotEmpty
(
salaryMonth
,
DefaultErrorEnum
.
DATA_NULL
,
"salaryMonth not be null"
);
RpcAssert
.
assertNotNull
(
businessType
,
DefaultErrorEnum
.
DATA_NULL
,
"businessType not be null"
);
try
{
String
monthFirstAndLastDayTime
=
DateUtils
.
getMonthFirstAndLastDayTime
(
salaryMonth
);
String
startDate
=
monthFirstAndLastDayTime
.
split
(
","
)[
0
];
String
endDate
=
monthFirstAndLastDayTime
.
split
(
","
)[
1
];
GoodsOrderDTO
condition
=
GoodsOrderDTO
.
builder
()
.
paySuccessStartDate
(
startDate
).
paySuccessEndDate
(
endDate
)
.
notAllRefund
(
true
).
sellerPhone
(
staffPhone
)
.
statusList
(
Arrays
.
asList
(
OrderStatus
.
PAYED
.
getValue
(),
OrderStatus
.
FINISHED
.
getValue
(),
OrderStatus
.
REFUNDED
.
getValue
()))
.
build
();
final
Date
now
=
new
Date
();
StaffMonthBusinessData
data
=
StaffMonthBusinessData
.
builder
()
.
staffPhone
(
staffPhone
).
salaryMonth
(
salaryMonth
)
.
businessType
(
businessType
.
getValue
())
.
orderTotalPrice
(
BigDecimal
.
ZERO
)
.
commissionPrice
(
BigDecimal
.
ZERO
)
.
createdBy
(
CommonConstants
.
DEFAULT_UPDATE_BY
).
createdDate
(
now
)
.
updatedBy
(
CommonConstants
.
DEFAULT_UPDATE_BY
).
updatedDate
(
now
)
.
deletedFlag
(
DeletedFlagEnum
.
N
.
name
())
.
build
();
OrderCountDTO
orderCount
=
null
;
switch
(
businessType
)
{
case
EQUITY:
condition
.
setSceneType
(
SceneTypeEnum
.
SCENE1_0
.
getValue
());
//权益服务
condition
.
setUpgradeGoodsTypeList
(
CommonUtil
.
convert2Integer
(
OrePropertyConfigurer
.
getString
(
"smartcarlife.goodsType.equity"
,
"126"
).
split
(
","
)));
orderCount
=
goodsOrderRemote
.
countSubOrderTotal
(
condition
).
getResult
();
break
;
case
EXTENDED_WARRANTY:
condition
.
setSceneType
(
SceneTypeEnum
.
SCENE1_0
.
getValue
());
//延保类
condition
.
setUpgradeGoodsTypeList
(
CommonUtil
.
convert2Integer
(
OrePropertyConfigurer
.
getString
(
"smartcarlife.goodsType.extendedInsurance"
,
"155"
).
split
(
","
)));
orderCount
=
goodsOrderRemote
.
countSubOrderTotal
(
condition
).
getResult
();
break
;
case
LIGHTLY_MODIFY:
condition
.
setSceneType
(
SceneTypeEnum
.
SCENE1_1
.
getValue
());
orderCount
=
goodsOrderRemote
.
countOrderTotal
(
condition
).
getResult
();
break
;
default
:
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVER_ERROR
,
"业务类型错误"
);
}
if
(
orderCount
!=
null
&&
orderCount
.
getTotalOutputPrice
()
!=
null
)
{
data
.
setOrderTotalPrice
(
orderCount
.
getTotalOutputPrice
());
}
//TODO //填充提成
return
data
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthSalarySlipService.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
.
salary
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.List
;
import
java.util.Objects
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.StaffBehaviorDeductMoneyRecordDTO
;
import
cn.com.glsx.dj.smartcarlife.enums.MerchantPerformanceConfigEnum.BehaviorDeductType
;
import
cn.com.glsx.dj.smartcarlife.model.StaffConfig
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffBehaviorDeductMoneyRecordRemote
;
import
cn.com.glsx.dj.smartcarlife.util.DateUtils
;
import
cn.com.glsx.dj.staff.constant.CommonConstants
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.mapper.StaffMonthSalarySlipMapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.dj.staff.util.CommonUtil
;
import
cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.enums.StatusEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.util.RpcAssert
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
@Service
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
rollbackFor
=
RpcServiceException
.
class
)
public
class
StaffMonthSalarySlipService
{
@Lazy
@Autowired
private
StaffMonthSalarySlipService
thiz
;
@Autowired
private
StaffMonthSalarySlipMapper
staffMonthSalarySlipMapper
;
@Autowired
private
StaffBaseInfoRemote
staffBaseInfoRemote
;
@Autowired
private
StaffMonthBusinessDataService
staffMonthBusinessDataService
;
@Autowired
private
StaffBehaviorDeductMoneyRecordRemote
staffBehaviorDeductMoneyRecordRemote
;
public
StaffMonthSalarySlip
get
(
String
staffPhone
,
String
salaryMonth
)
{
RpcAssert
.
assertNotEmpty
(
staffPhone
,
DefaultErrorEnum
.
DATA_NULL
,
"staffPhone not be null"
);
RpcAssert
.
assertNotEmpty
(
salaryMonth
,
DefaultErrorEnum
.
DATA_NULL
,
"salaryMonth not be null"
);
try
{
return
CommonUtil
.
getFirst
(
staffMonthSalarySlipMapper
.
select
(
StaffMonthSalarySlip
.
builder
()
.
staffPhone
(
staffPhone
).
salaryMonth
(
salaryMonth
).
deletedFlag
(
DeletedFlagEnum
.
N
.
name
())
.
build
()));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
StaffMonthSalarySlip
statMonthSalary
(
StaffMonthSalarySlip
info
)
{
RpcAssert
.
assertNotNull
(
info
,
DefaultErrorEnum
.
DATA_NULL
,
"StaffMonthSalarySlip not be null"
);
RpcAssert
.
assertNotEmpty
(
info
.
getStaffPhone
(),
DefaultErrorEnum
.
DATA_NULL
,
"StaffMonthSalarySlip.staffPhone not be null"
);
RpcAssert
.
assertNotEmpty
(
info
.
getStaffName
(),
DefaultErrorEnum
.
DATA_NULL
,
"StaffMonthSalarySlip.staffName not be null"
);
RpcAssert
.
assertNotEmpty
(
info
.
getSalaryMonth
(),
DefaultErrorEnum
.
DATA_NULL
,
"StaffMonthSalarySlip.salaryMonth not be null"
);
RpcAssert
.
assertNotEmpty
(
info
.
getFinalDataFlag
(),
DefaultErrorEnum
.
DATA_NULL
,
"StaffMonthSalarySlip.finalDataFlag not be null"
);
RpcAssert
.
assertNotEmpty
(
info
.
getUpdatedBy
(),
DefaultErrorEnum
.
DATA_NULL
,
"StaffMonthSalarySlip.updatedBy not be null"
);
try
{
StaffMonthSalarySlip
oldRecord
=
thiz
.
get
(
info
.
getStaffPhone
(),
info
.
getSalaryMonth
());
//TODO 提成需在此之前计算完
List
<
StaffMonthBusinessData
>
staffMonthBusinessDataList
=
staffMonthBusinessDataService
.
updateStaffMonthBusinessData
(
info
.
getStaffPhone
(),
info
.
getSalaryMonth
());
BigDecimal
orderTotalPrice
=
BigDecimal
.
ZERO
;
BigDecimal
commissionPrice
=
BigDecimal
.
ZERO
;
for
(
StaffMonthBusinessData
staffMonthBusinessData:
staffMonthBusinessDataList
)
{
orderTotalPrice
=
orderTotalPrice
.
add
(
staffMonthBusinessData
.
getOrderTotalPrice
());
commissionPrice
=
commissionPrice
.
add
(
staffMonthBusinessData
.
getCommissionPrice
());
}
List
<
StaffBehaviorDeductMoneyRecordDTO
>
staffBehaviorDeductList
=
staffBehaviorDeductMoneyRecordRemote
.
list
(
StaffBehaviorDeductMoneyRecordDTO
.
builder
()
.
staffPhone
(
info
.
getStaffPhone
()).
deductMonth
(
info
.
getSalaryMonth
())
.
build
()).
getResult
();
int
dailyDeductCount
=
0
;
int
padDeductCount
=
0
;
if
(
CollectionUtils
.
isNotEmpty
(
staffBehaviorDeductList
))
{
for
(
StaffBehaviorDeductMoneyRecordDTO
deduct:
staffBehaviorDeductList
)
{
if
(
Objects
.
equals
(
deduct
.
getBehaviorDeductType
(),
BehaviorDeductType
.
DAILY
.
getValue
())){
dailyDeductCount
+=
deduct
.
getBehaviorCount
();
}
else
if
(
Objects
.
equals
(
deduct
.
getBehaviorDeductType
(),
BehaviorDeductType
.
PAD
.
getValue
()))
{
padDeductCount
+=
deduct
.
getBehaviorCount
();
}
}
}
StaffMonthSalarySlip
data
=
StaffMonthSalarySlip
.
builder
()
.
shouldWorkDay
(
BigDecimal
.
ZERO
)
//TODO 应出勤天数 富康提供
.
actualWorkDay
(
BigDecimal
.
ZERO
)
//TODO 实际出勤天数 富康提供
.
salaryStandard
(
BigDecimal
.
ZERO
)
//TODO 薪资标准 富康提供
.
performanceLevel
((
byte
)
1
)
//TODO 绩效等级 富康提供
.
performanceSalary
(
BigDecimal
.
ZERO
)
//TODO 绩效工资 富康提供
.
minimumSalary
(
BigDecimal
.
ZERO
)
//TODO 底薪 富康提供
.
build
();
//基本工资 = 底薪+绩效工资
data
.
setBasicSalary
(
data
.
getMinimumSalary
().
add
(
data
.
getPerformanceSalary
()));
data
.
setOrderTotalPrice
(
orderTotalPrice
);
data
.
setCommissionPrice
(
commissionPrice
);
data
.
setDailyDeductCount
(
dailyDeductCount
);
data
.
setPadDeductCount
(
padDeductCount
);
//递延金收入 6个月前的递延金支出作为6个月后收入
String
deferMonth
=
DateUtils
.
getPreviousMonth
(
info
.
getSalaryMonth
(),
6
);
StaffMonthSalarySlip
deferMonthRecord
=
thiz
.
get
(
info
.
getStaffPhone
(),
deferMonth
);
if
(
deferMonthRecord
!=
null
)
{
data
.
setDeferIncome
(
deferMonthRecord
.
getDeferExpenses
());
}
else
{
data
.
setDeferIncome
(
BigDecimal
.
ZERO
);
}
//数据只能导入更新
data
.
setOtherDeduction
(
BigDecimal
.
ZERO
);
data
.
setOtherRewards
(
BigDecimal
.
ZERO
);
StaffConfig
sc
=
staffBaseInfoRemote
.
getStaffConfig
(
info
.
getStaffPhone
()).
getResult
();
if
(
sc
!=
null
)
{
if
(
Objects
.
equals
(
sc
.
getDeferredOpenFlag
(),
StatusEnum
.
YES
.
getValue
()))
{
data
.
setDeferredRatio
(
sc
.
getDeferredRatio
());
}
if
(
Objects
.
equals
(
sc
.
getDailyOpenFlag
(),
StatusEnum
.
YES
.
getValue
()))
{
data
.
setDailyDeduction
(
sc
.
getDailyDeduction
());
}
if
(
Objects
.
equals
(
sc
.
getPadOpenFlag
(),
StatusEnum
.
YES
.
getValue
()))
{
data
.
setPadDeduction
(
sc
.
getPadDeduction
());
}
}
//递延金支出 需判断员工是否配置递延金开关及百分比
if
(
data
.
getDeferredRatio
()
!=
null
)
{
data
.
setDeferExpenses
(
data
.
getCommissionPrice
().
multiply
(
data
.
getDeferredRatio
())
.
divide
(
CommonConstants
.
ONEHUNDRED_BIGDECIMAL
,
2
,
RoundingMode
.
HALF_UP
));
}
else
{
data
.
setDeferExpenses
(
BigDecimal
.
ZERO
);
}
if
(
data
.
getDailyDeduction
()
!=
null
)
{
data
.
setDailyDeductMoney
(
data
.
getDailyDeduction
().
multiply
(
BigDecimal
.
valueOf
(
data
.
getDailyDeductCount
())));
}
else
{
data
.
setDailyDeductMoney
(
BigDecimal
.
ZERO
);
}
if
(
data
.
getPadDeduction
()
!=
null
)
{
data
.
setPadDeductMoney
(
data
.
getPadDeduction
().
multiply
(
BigDecimal
.
valueOf
(
data
.
getPadDeductCount
())));
}
else
{
data
.
setPadDeductMoney
(
BigDecimal
.
ZERO
);
}
//工资=基本工资(底薪+绩效工资) + 总提成 + 递延金收入 - 递延金支出 - 日报扣款 - 平板扣款 - 其他扣除 + 其他奖励
BigDecimal
salary
=
data
.
getBasicSalary
().
add
(
data
.
getCommissionPrice
()).
add
(
data
.
getDeferIncome
())
.
subtract
(
data
.
getDeferExpenses
()).
subtract
(
data
.
getDailyDeductMoney
()).
subtract
(
data
.
getPadDeductMoney
())
.
subtract
(
data
.
getOtherDeduction
()).
add
(
data
.
getOtherRewards
())
;
data
.
setSalary
(
salary
);
//data.setCorrectSalary(salary);
if
(
oldRecord
!=
null
)
{
data
.
setId
(
oldRecord
.
getId
());
data
.
setCreatedDate
(
oldRecord
.
getCreatedDate
());
staffMonthSalarySlipMapper
.
updateByPrimaryKey
(
data
);
}
else
{
staffMonthSalarySlipMapper
.
insertUseGeneratedKeys
(
data
);
}
return
data
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
public
Page
<
StaffMonthSalarySlipDTO
>
pageStaffMonthSalary
(
RpcPagination
<
StaffMonthSalarySlipDTO
>
pagination
)
{
try
{
Page
<
StaffMonthSalarySlipDTO
>
page
=
PageHelper
.
startPage
(
pagination
.
getPageNum
(),
pagination
.
getPageSize
(),
pagination
.
isNeedCount
());
staffMonthSalarySlipMapper
.
list
(
pagination
.
getCondition
());
return
page
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
public
StaffMonthSalarySlipDTO
statStaffMonthSalary
(
StaffMonthSalarySlipDTO
dto
){
try
{
return
staffMonthSalarySlipMapper
.
statStaffMonthSalary
(
dto
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/util/CommonUtil.java
View file @
37aaebe
...
@@ -4,6 +4,7 @@ package cn.com.glsx.dj.staff.util;
...
@@ -4,6 +4,7 @@ package cn.com.glsx.dj.staff.util;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Slf4j
...
@@ -15,5 +16,18 @@ public class CommonUtil {
...
@@ -15,5 +16,18 @@ public class CommonUtil {
}
}
return
null
;
return
null
;
}
}
public
static
List
<
Integer
>
convert2Integer
(
String
[]
strArr
)
{
if
(
strArr
==
null
||
strArr
.
length
==
0
)
{
return
null
;
}
List
<
Integer
>
list
=
new
ArrayList
<>();
for
(
String
s:
strArr
)
{
try
{
list
.
add
(
Integer
.
valueOf
(
s
));
}
catch
(
Exception
e
)
{
}
}
return
list
.
isEmpty
()
?
null
:
list
;
}
}
}
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthBusinessDataMapper.xml
View file @
37aaebe
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"staff_phone"
property=
"staffPhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_phone"
property=
"staffPhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"salary_month"
property=
"salaryMonth"
jdbcType=
"CHAR"
/>
<result
column=
"salary_month"
property=
"salaryMonth"
jdbcType=
"CHAR"
/>
<result
column=
"business_type"
property=
"businessType"
jdbcType=
"VARCHAR"
/>
<result
column=
"business_type"
property=
"businessType"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
...
...
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthSalarySlipMapper.xml
View file @
37aaebe
...
@@ -20,16 +20,19 @@
...
@@ -20,16 +20,19 @@
<result
column=
"basic_salary"
property=
"basicSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"basic_salary"
property=
"basicSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduct_count"
property=
"dailyDeductCount"
/>
<result
column=
"daily_deduct_money"
property=
"dailyDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduct_money"
property=
"dailyDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduct_count"
property=
"padDeductCount"
/>
<result
column=
"pad_deduct_money"
property=
"padDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduct_money"
property=
"padDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_expenses"
property=
"deferExpenses"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_expenses"
property=
"deferExpenses"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_income"
property=
"deferIncome"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_income"
property=
"deferIncome"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduction"
property=
"dailyDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduction"
property=
"dailyDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduction"
property=
"padDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduction"
property=
"padDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"deferred_ratio"
property=
"deferredRatio"
jdbcType=
"DECIMAL"
/>
<result
column=
"deferred_ratio"
property=
"deferredRatio"
jdbcType=
"DECIMAL"
/>
<result
column=
"refund_offset"
property=
"refundOffset"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_deduction"
property=
"otherDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_deduction"
property=
"otherDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_deduction_detail"
property=
"otherDeductionDetail"
/>
<result
column=
"other_rewards"
property=
"otherRewards"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_rewards"
property=
"otherRewards"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_rewards_detail"
property=
"otherRewardsDetail"
/>
<result
column=
"salary"
property=
"salary"
jdbcType=
"DECIMAL"
/>
<result
column=
"salary"
property=
"salary"
jdbcType=
"DECIMAL"
/>
<result
column=
"correct_salary"
property=
"correctSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"correct_salary"
property=
"correctSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
...
@@ -38,15 +41,61 @@
...
@@ -38,15 +41,61 @@
<result
column=
"updated_date"
property=
"updatedDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"updated_date"
property=
"updatedDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
</resultMap>
</resultMap>
<resultMap
id=
"DTOResultMap"
type=
"cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO"
extends=
"BaseResultMap"
>
<result
column=
"totalActualSalary"
property=
"totalActualSalary"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, staff_name, staff_phone, business_types, salary_month, final_data_flag, should_work_day,
id, staff_name, staff_phone, business_types, salary_month, final_data_flag, should_work_day,
actual_work_day, salary_standard, minimum_salary, performance_level, performance_salary,
actual_work_day, salary_standard, minimum_salary, performance_level, performance_salary,
basic_salary, order_total_price, commission_price,
daily_deduct_money
, pad_deduct_money,
basic_salary, order_total_price, commission_price,
daily_deduct_count, daily_deduct_money,pad_deduct_count
, pad_deduct_money,
defer_expenses, defer_income, daily_deduction, pad_deduction, deferred_ratio,
refund_offset,
defer_expenses, defer_income, daily_deduction, pad_deduction, deferred_ratio,
other_deduction,
other_rewards
, salary, correct_salary, created_by, created_date,
other_deduction,
other_deduction_detail, other_rewards,other_rewards_detail
, salary, correct_salary, created_by, created_date,
updated_by, updated_date, deleted_flag
updated_by, updated_date, deleted_flag
</sql>
</sql>
<select
id=
"list"
parameterType=
"cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO"
resultMap=
"DTOResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from dj_car_life_staff_month_salary_slip
<include
refid=
"list_condition"
/>
order by salary_month desc
</select>
<select
id=
"statStaffMonthSalary"
resultMap=
"DTOResultMap"
>
select ifnull(sum(ifnull(correct_salary, salary)), 0) totalActualSalary
from dj_car_life_staff_month_salary_slip
<include
refid=
"list_condition"
/>
</select>
<sql
id=
"list_condition"
>
<where>
deleted_flag = 'N'
<if
test=
"staffPhone != null and staffPhone != ''"
>
and staff_phone = #{staffPhone}
</if>
<if
test=
"staffPhones != null and staffPhones.size()>0"
>
and staff_phone in
<foreach
collection=
"staffPhones"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"salaryMonthList != null and salaryMonthList.size()>0"
>
and salary_month in
<foreach
collection=
"salaryMonthList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"salaryMonth != null and salaryMonth != ''"
>
and salary_month = #{salaryMonth}
</if>
<if
test=
"salaryMonthBegin != null and salaryMonthBegin != ''"
>
and salary_month
>
= #{salaryMonthBegin}
</if>
<if
test=
"salaryMonthEnd != null and salaryMonthEnd != ''"
>
and salary_month
<
= #{salaryMonthEnd}
</if>
</where>
</sql>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment