zhangqian
2024-05-07 85faccc42c06891840a322e748a413a07a018f8f
工人,工种软删除
3个文件已修改
29 ■■■■ 已修改文件
models/work_type_manage.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/worker.go 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/salary_calculate.go 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/work_type_manage.go
@@ -115,7 +115,7 @@
func (slf *WorkTypeManageSearch) Delete() error {
    var db = slf.build()
    if err := db.Unscoped().Delete(&WorkTypeManage{}).Error; err != nil {
    if err := db.Delete(&WorkTypeManage{}).Error; err != nil {
        return err
    }
models/worker.go
@@ -11,6 +11,7 @@
    // Worker 人力资源
    Worker struct {
        BaseModelString
        DeletedAt      gorm.DeletedAt        `gorm:"index"`
        Name           string                `gorm:"index;type:varchar(191);not null;comment:人员姓名" json:"name"`
        PhoneNum       string                `gorm:"type:varchar(191);comment:手机号" json:"phoneNum"`
        ShopID         string                `gorm:"type:varchar(191);comment:所属车间ID" json:"shopId"`
@@ -200,7 +201,7 @@
func (slf *WorkerSearch) Delete() error {
    var db = slf.build()
    if err := db.Unscoped().Delete(&Worker{}).Error; err != nil {
    if err := db.Delete(&Worker{}).Error; err != nil {
        return err
    }
utils/salary_calculate.go
@@ -10,21 +10,21 @@
// 薪资计算数据
type SalaryCalculateData struct {
    DailySilkProduction     decimal.Decimal `json:"dailySilkProduction"`     // 日产丝量
    WasteSilkQuantity       decimal.Decimal `json:"wasteSilkQuantity"`       // 野纤数量
    RawSilkUnitPrice        decimal.Decimal `json:"rawSilkUnitPrice"`        // 生丝单价
    WasteSilkUnitPrice      decimal.Decimal `json:"wasteSilkUnitPrice"`      // 野纤单价
    BucketCount             decimal.Decimal `json:"bucketCount"`             //桶数(日)
    AttendanceDays          int             `json:"attendanceDays"`          // 出勤天数
    GroupAverageMonthlyWage decimal.Decimal `json:"groupAverageMonthlyWage"` //同组挡车工月平均工资
    GroupCarHeadWage        decimal.Decimal `json:"groupCarHeadWage"`        //同组车头工工资
    WasteSilkQuantity       decimal.Decimal `json:"wasteSilkQuantity"`       // 野纤数量  //todo
    RawSilkUnitPrice        decimal.Decimal `json:"rawSilkUnitPrice"`        // 生丝单价  //todo
    WasteSilkUnitPrice      decimal.Decimal `json:"wasteSilkUnitPrice"`      // 野纤单价 //todo
    BucketCount             decimal.Decimal `json:"bucketCount"`             //桶数(日) //todo
    AttendanceDays          int             `json:"attendanceDays"`          // 出勤天数 //todo
    GroupAverageMonthlyWage decimal.Decimal `json:"groupAverageMonthlyWage"` //同组挡车工月平均工资 //todo
    GroupCarHeadWage        decimal.Decimal `json:"groupCarHeadWage"`        //同组车头工工资 //todo
    WeekdayOvertimeHours decimal.Decimal `json:"weekdayOvertimeHours"` // 工作日加班时长
    FullAttendanceAward  int             `json:"FullAttendanceAward"`  // 满勤奖
    WeekendOvertimeHours decimal.Decimal `json:"weekendOvertimeHours"` // 休息日加班时长
    LeaveDays            decimal.Decimal `json:"LeaveDays"`            //请假天数
    ApprenticeDays       decimal.Decimal `json:"apprenticeDays"`       // 带徒天数
    FullAttendanceAward  int             `json:"FullAttendanceAward"`  // 满勤奖 //todo
    WeekendOvertimeHours decimal.Decimal `json:"weekendOvertimeHours"` // 休息日加班时长 //todo
    LeaveDays            decimal.Decimal `json:"LeaveDays"`            //请假天数 //todo
    ApprenticeDays       decimal.Decimal `json:"apprenticeDays"`       // 带徒天数 //todo
    TotalAttendanceDays  int             `json:"totalAttendanceDays"`  // 出勤天数
    Seniority            decimal.Decimal `json:"seniority"`            // 工龄
    Seniority            decimal.Decimal `json:"seniority"`            // 工龄 //todo
}
// CalculateSalary 计算工资的函数