From b94bef381946e22fd1038f24e6d9de911d194640 Mon Sep 17 00:00:00 2001 From: yinbentan <yinbentan@live.com> Date: 星期三, 31 七月 2024 23:33:48 +0800 Subject: [PATCH] 功能修改,工资计算调整,通过前端配置公式进行计算 --- models/payroll_other_subsidies.go | 28 ++++++++++------------------ 1 files changed, 10 insertions(+), 18 deletions(-) diff --git a/models/payroll_other_subsidies.go b/models/payroll_other_subsidies.go index f90429c..664cdef 100644 --- a/models/payroll_other_subsidies.go +++ b/models/payroll_other_subsidies.go @@ -12,15 +12,16 @@ // PayrollOtherSubsidies 鍏跺畠琛ヨ创銆佸鎯� PayrollOtherSubsidies struct { BaseModelInt - Cycle string `json:"cycle" gorm:"index;size:20;not null;comment:缁熻鍛ㄦ湡"` //鏈堜唤 - WorkerID string `json:"workerId" gorm:"size:200;not null;comment:鍛樺伐ID"` //鍛樺伐ID - Worker Worker `json:"worker" gorm:"foreignKey:WorkerID;references:ID"` - WorkTypeID uint `json:"workTypeID" gorm:"type:bigint(20);not null;comment:宸ョID"` //宸ョID - WorkTypeCode constvar.JobType `json:"workTypeCode" gorm:"size:255;not null;comment:宸ョ浠g爜"` //宸ョ浠g爜 - WorkTypeName string `json:"workTypeName" gorm:"size:255;not null;comment:宸ョ鍚嶇О"` //宸ョ鍚嶇О - SubsidyType constvar.PayrollSubsidyType `json:"subsidyType" gorm:"size:50;not null;comment:琛ヨ创绫诲瀷"` // 琛ヨ创绫诲瀷 - SubsidyTypeName string `json:"subsidyTypeName" gorm:"size:255;comment:琛ヨ创绫诲瀷鍚嶇О"` // 琛ヨ创绫诲瀷鍚嶇О - Amount decimal.Decimal `json:"amount" gorm:"type:decimal(12,4);comment:閲戦"` // 閲戦 + Cycle string `json:"cycle" gorm:"index;size:20;not null;comment:缁熻鍛ㄦ湡"` //鏈堜唤 + WorkerID string `json:"workerId" gorm:"size:200;not null;comment:鍛樺伐ID"` //鍛樺伐ID + Worker Worker `json:"worker" gorm:"foreignKey:WorkerID;references:ID"` + WorkTypeID uint `json:"workTypeID" gorm:"type:bigint(20);not null;comment:宸ョID"` //宸ョID + WorkTypeCode constvar.JobType `json:"workTypeCode" gorm:"size:255;not null;comment:宸ョ浠g爜"` //宸ョ浠g爜 + WorkTypeName string `json:"workTypeName" gorm:"size:255;not null;comment:宸ョ鍚嶇О"` //宸ョ鍚嶇О + SalaryPlanId uint `json:"salaryPlanId" gorm:"type:bigint(20);not null;comment:钖祫鏂规ID"` //钖祫鏂规ID + SalaryPlan SalaryPlan `json:"subsidyTypeName" gorm:"foreignKey:SalaryPlanId;references:ID"` //钖祫鏂规 + SalaryFormula string `json:"salaryFormula" gorm:"size:255;not null;comment:钖祫鏂规(缈昏瘧鍚�)"` //钖祫鏂规 + Amount decimal.Decimal `json:"amount" gorm:"type:decimal(12,4);comment:閲戦"` // 閲戦 } PayrollOtherSubsidiesSearch struct { @@ -83,11 +84,6 @@ return slf } -func (slf *PayrollOtherSubsidiesSearch) SetSubsidyType(subsidyType constvar.PayrollSubsidyType) *PayrollOtherSubsidiesSearch { - slf.SubsidyType = subsidyType - return slf -} - func (slf *PayrollOtherSubsidiesSearch) build() *gorm.DB { var db = slf.Orm.Table(slf.TableName()) @@ -113,10 +109,6 @@ if slf.WorkerID != "" { db = db.Where("worker_id = ?", slf.WorkerID) - } - - if slf.SubsidyType != "" { - db = db.Where("subsidy_type = ?", slf.SubsidyType) } db.Where("1 = 1") -- Gitblit v1.8.0