作者 Your Name

调整新增工时的参数

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