作者 Your Name

Merge branch 'dev' into test

package dto
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
"time"
)
type AttendanceRecordDto struct {
... ... @@ -63,7 +64,9 @@ func (d *AttendanceRecordDto) LoadDto(m *domain.ProductAttendanceRecord, orgId i
d.WorkTimeAfter = m.WorkTimeAfter
d.AttendanceStatus = m.AttendanceStatus
d.AuthFlag = domain.CheckOrgAuth(orgId, m.OrgId)
if m.Ext != nil {
d.OrgName = m.Ext.OrgName
}
d.ApproveUser = m.ApproveUser()
d.GroupName = m.GroupName()
if m.Ext != nil && m.Ext.AttendanceExt != nil {
... ...
... ... @@ -11,6 +11,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/ecelData/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/domainService"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils/converter"
)
... ... @@ -114,6 +115,19 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param
defer func() {
transactionContext.RollbackTransaction()
}()
//获取当前操作人
userSrv := domainService.NewUserService()
operateUser, err := userSrv.User(operate.UserId)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "查询操作人数据失败。"+err.Error())
}
//获取当前操作人的组织
var org *domain.Org
org, err = userSrv.Organization(operate.OrgId)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
//车间数据
//生产班组 数据
productGroupRepo, _ := factory.CreateProductGroupRepository(map[string]interface{}{
... ... @@ -267,6 +281,7 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param
DeletedAt: time.Time{},
ProductDate: productDate,
Ext: &domain.Ext{
OrgName: org.OrgName,
DeviceExt: &domain.DeviceExt{},
ProductPlanExt: &domain.ProductPlanExt{},
AttendanceExt: &domain.ProductAttendanceRecordExt{},
... ...