作者 Your Name

调整新增工时的参数

@@ -2,10 +2,11 @@ package command @@ -2,10 +2,11 @@ package command
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 - "github.com/beego/beego/v2/core/validation"  
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"  
7 "reflect" 5 "reflect"
8 "strings" 6 "strings"
  7 +
  8 + "github.com/beego/beego/v2/core/validation"
  9 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
9 ) 10 )
10 11
11 type CreateAttendanceCommand struct { 12 type CreateAttendanceCommand struct {
@@ -14,7 +15,7 @@ type CreateAttendanceCommand struct { @@ -14,7 +15,7 @@ type CreateAttendanceCommand struct {
14 // 考勤类型 1.正常 2.支援 15 // 考勤类型 1.正常 2.支援
15 AttendanceType int `cname:"考勤类型" json:"attendanceType,omitempty"` 16 AttendanceType int `cname:"考勤类型" json:"attendanceType,omitempty"`
16 // 生产班组Id 17 // 生产班组Id
17 - ProductGroupId int `cname:"生产班组Id" json:"productGroupId,omitempty" valid:"Required"` 18 + // ProductGroupId int `cname:"生产班组Id" json:"productGroupId,omitempty" valid:"Required"`
18 // 生产工人 19 // 生产工人
19 ProductWorkerId int `cname:"生产工人" json:"productWorkerId,omitempty" valid:"Required"` 20 ProductWorkerId int `cname:"生产工人" json:"productWorkerId,omitempty" valid:"Required"`
20 // 车间ID 21 // 车间ID
@@ -105,11 +105,11 @@ func (attendanceService *AttendanceService) CreateAttendance(operateInfo *domain @@ -105,11 +105,11 @@ func (attendanceService *AttendanceService) CreateAttendance(operateInfo *domain
105 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 105 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
106 } 106 }
107 107
108 - var productGroup *domain.ProductGroup  
109 - _, productGroup, err = factory.FastPgProductGroup(transactionContext, cmd.ProductGroupId)  
110 - if err != nil {  
111 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
112 - } 108 + // var productGroup *domain.ProductGroup
  109 + // _, productGroup, err = factory.FastPgProductGroup(transactionContext, cmd.ProductGroupId)
  110 + // if err != nil {
  111 + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  112 + // }
113 113
114 //var workTime float64 = 0 114 //var workTime float64 = 0
115 //if cmd.WorkTime-cmd.BreakTime > 0 { 115 //if cmd.WorkTime-cmd.BreakTime > 0 {
@@ -145,9 +145,9 @@ func (attendanceService *AttendanceService) CreateAttendance(operateInfo *domain @@ -145,9 +145,9 @@ func (attendanceService *AttendanceService) CreateAttendance(operateInfo *domain
145 CreatedAt: time.Now(), 145 CreatedAt: time.Now(),
146 UpdatedAt: time.Now(), 146 UpdatedAt: time.Now(),
147 Ext: domain.NewExt(org.OrgName).WithAttendanceExt(&domain.ProductAttendanceRecordExt{ 147 Ext: domain.NewExt(org.OrgName).WithAttendanceExt(&domain.ProductAttendanceRecordExt{
148 - GroupName: productGroup.GroupName,  
149 - ProductGroupId: productGroup.ProductGroupId,  
150 - BreakTime: cmd.BreakTime, 148 + // GroupName: productGroup.GroupName,
  149 + // ProductGroupId: productGroup.ProductGroupId,
  150 + BreakTime: cmd.BreakTime,
151 }), 151 }),
152 ProductDate: productDate, 152 ProductDate: productDate,
153 } 153 }