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())