From de6cfbc7738303389ae0ff74809b4d80e6f5111a Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Wed, 2 Apr 2025 18:07:40 +0800 Subject: [PATCH] AttendDay2 --- service/staff_salary.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/service/staff_salary.go b/service/staff_salary.go index 207bc93..1adc3ec 100644 --- a/service/staff_salary.go +++ b/service/staff_salary.go @@ -103,14 +103,16 @@ func (s *StaffSalary) CalcSalary(salary *model.StaffSalary, month, expr string) func (s *StaffSalary) calculate(corp *model.Corp, salary *model.StaffSalary, expression string) { - //获取基础数据 - data := s.getCalcData(salary) - //获取业务数据 dataFactory := registry.NewSalaryCalculator(corp, s.user) + var biz interface{} = nil if dataFactory != nil { - data["biz"] = dataFactory.Calculate(salary) + biz = dataFactory.Calculate(salary) } + + data := s.getCalcData(salary) + data["biz"] = biz + salary.Extra = goutil.EncodeJSONIndent(data) salary.SetExtra("calculate", goutil.GetNowTime())