正在显示
7 个修改的文件
包含
10 行增加
和
31 行删除
| @@ -266,6 +266,11 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param | @@ -266,6 +266,11 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param | ||
| 266 | UpdatedAt: nowTime, | 266 | UpdatedAt: nowTime, |
| 267 | DeletedAt: time.Time{}, | 267 | DeletedAt: time.Time{}, |
| 268 | ProductDate: productDate, | 268 | ProductDate: productDate, |
| 269 | + Ext: &domain.Ext{ | ||
| 270 | + DeviceExt: &domain.DeviceExt{}, | ||
| 271 | + ProductPlanExt: &domain.ProductPlanExt{}, | ||
| 272 | + AttendanceExt: &domain.ProductAttendanceRecordExt{}, | ||
| 273 | + }, | ||
| 269 | } | 274 | } |
| 270 | //计算工时 | 275 | //计算工时 |
| 271 | workTime := tempItem.ComputeWorkTime(beakTime) | 276 | workTime := tempItem.ComputeWorkTime(beakTime) |
| @@ -554,9 +554,6 @@ func (srv *ProductRecordService) BatchAddProductCapacities(operate *domain.Opera | @@ -554,9 +554,6 @@ func (srv *ProductRecordService) BatchAddProductCapacities(operate *domain.Opera | ||
| 554 | if err := transactionContext.CommitTransaction(); err != nil { | 554 | if err := transactionContext.CommitTransaction(); err != nil { |
| 555 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 555 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 556 | } | 556 | } |
| 557 | - if err := transactionContext.CommitTransaction(); err != nil { | ||
| 558 | - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 559 | - } | ||
| 560 | return failRows, nil | 557 | return failRows, nil |
| 561 | } | 558 | } |
| 562 | 559 |
| @@ -160,6 +160,9 @@ func (productAttendanceRecord *ProductAttendanceRecord) Approve(approveUser *Use | @@ -160,6 +160,9 @@ func (productAttendanceRecord *ProductAttendanceRecord) Approve(approveUser *Use | ||
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | func (productAttendanceRecord *ProductAttendanceRecord) ProductTime() time.Time { | 162 | func (productAttendanceRecord *ProductAttendanceRecord) ProductTime() time.Time { |
| 163 | + if productAttendanceRecord.Ext == nil { | ||
| 164 | + return time.Time{} | ||
| 165 | + } | ||
| 163 | attendanceExt := productAttendanceRecord.Ext.AttendanceExt | 166 | attendanceExt := productAttendanceRecord.Ext.AttendanceExt |
| 164 | if attendanceExt != nil && !xtime.IsZero(productAttendanceRecord.ProductDate) { | 167 | if attendanceExt != nil && !xtime.IsZero(productAttendanceRecord.ProductDate) { |
| 165 | return productAttendanceRecord.ProductDate | 168 | return productAttendanceRecord.ProductDate |
| @@ -232,8 +235,8 @@ func (productAttendanceRecord *ProductAttendanceRecord) AttendanceBreakTime(prod | @@ -232,8 +235,8 @@ func (productAttendanceRecord *ProductAttendanceRecord) AttendanceBreakTime(prod | ||
| 232 | return bt | 235 | return bt |
| 233 | } | 236 | } |
| 234 | 237 | ||
| 235 | -//计算上岗到 离岗之间的工作时间, | ||
| 236 | -//breakTime 休息时间(小时) | 238 | +// 计算上岗到 离岗之间的工作时间, |
| 239 | +// breakTime 休息时间(小时) | ||
| 237 | func (productAttendanceRecord *ProductAttendanceRecord) ComputeWorkTime(breakTime float64) float64 { | 240 | func (productAttendanceRecord *ProductAttendanceRecord) ComputeWorkTime(breakTime float64) float64 { |
| 238 | signIn := roundTime(productAttendanceRecord.SignIn) | 241 | signIn := roundTime(productAttendanceRecord.SignIn) |
| 239 | signOut := roundTime(productAttendanceRecord.SignOut) | 242 | signOut := roundTime(productAttendanceRecord.SignOut) |
| @@ -50,10 +50,6 @@ type EmployeeProductRecord struct { | @@ -50,10 +50,6 @@ type EmployeeProductRecord struct { | ||
| 50 | ProductRecordInfo *ProductRecordStaticInfo `json:"productRecordInfo"` | 50 | ProductRecordInfo *ProductRecordStaticInfo `json:"productRecordInfo"` |
| 51 | // 生产工人 | 51 | // 生产工人 |
| 52 | ProductWorker *User `comment:"生产工人"` | 52 | ProductWorker *User `comment:"生产工人"` |
| 53 | - | ||
| 54 | - ApproveStatus int `json:"approveStatus"` // 审核状态 0:未审核 1:已审核 2.自动审核 | ||
| 55 | - ApproveAt *time.Time `json:"approveAt"` // 审核时间 | ||
| 56 | - ApproveUser *User `json:"approveUser"` // 审核人 | ||
| 57 | } | 53 | } |
| 58 | 54 | ||
| 59 | type EmployeeProductRecordRepository interface { | 55 | type EmployeeProductRecordRepository interface { |
| @@ -38,8 +38,4 @@ type EmployeeProductRecord struct { | @@ -38,8 +38,4 @@ type EmployeeProductRecord struct { | ||
| 38 | ProductRecordInfo *domain.ProductRecordStaticInfo `comment:"生产记录信息"` | 38 | ProductRecordInfo *domain.ProductRecordStaticInfo `comment:"生产记录信息"` |
| 39 | // 生产工人 | 39 | // 生产工人 |
| 40 | ProductWorker *domain.User `comment:"生产工人"` | 40 | ProductWorker *domain.User `comment:"生产工人"` |
| 41 | - | ||
| 42 | - ApproveStatus int `comment:"审核状态 0:未审核 1:已审核 2.自动审核"` // 审核状态 0:未审核 1:已审核 2.自动审核 | ||
| 43 | - ApproveAt *time.Time `comment:"审核时间"` // | ||
| 44 | - ApproveUser *domain.User `comment:"审核人"` // 审核人 | ||
| 45 | } | 41 | } |
| @@ -22,8 +22,5 @@ func TransformToEmployeeProductRecordDomainModelFromPgModels(employeeProductReco | @@ -22,8 +22,5 @@ func TransformToEmployeeProductRecordDomainModelFromPgModels(employeeProductReco | ||
| 22 | Version: employeeProductRecordModel.Version, | 22 | Version: employeeProductRecordModel.Version, |
| 23 | ProductRecordInfo: employeeProductRecordModel.ProductRecordInfo, | 23 | ProductRecordInfo: employeeProductRecordModel.ProductRecordInfo, |
| 24 | ProductWorker: employeeProductRecordModel.ProductWorker, | 24 | ProductWorker: employeeProductRecordModel.ProductWorker, |
| 25 | - ApproveStatus: employeeProductRecordModel.ApproveStatus, | ||
| 26 | - ApproveAt: employeeProductRecordModel.ApproveAt, | ||
| 27 | - ApproveUser: employeeProductRecordModel.ApproveUser, | ||
| 28 | }, nil | 25 | }, nil |
| 29 | } | 26 | } |
| @@ -42,9 +42,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | @@ -42,9 +42,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | ||
| 42 | "version", | 42 | "version", |
| 43 | "product_record_info", | 43 | "product_record_info", |
| 44 | "product_worker", | 44 | "product_worker", |
| 45 | - "approve_status", | ||
| 46 | - "approve_at", | ||
| 47 | - "approve_user", | ||
| 48 | } | 45 | } |
| 49 | insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "employee_product_record_id", "deleted_at")) | 46 | insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "employee_product_record_id", "deleted_at")) |
| 50 | insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "employee_product_record_id", "deleted_at")) | 47 | insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "employee_product_record_id", "deleted_at")) |
| @@ -70,9 +67,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | @@ -70,9 +67,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | ||
| 70 | &employeeProductRecord.Version, | 67 | &employeeProductRecord.Version, |
| 71 | &employeeProductRecord.ProductRecordInfo, | 68 | &employeeProductRecord.ProductRecordInfo, |
| 72 | &employeeProductRecord.ProductWorker, | 69 | &employeeProductRecord.ProductWorker, |
| 73 | - &employeeProductRecord.ApproveStatus, | ||
| 74 | - &employeeProductRecord.ApproveAt, | ||
| 75 | - &employeeProductRecord.ApproveUser, | ||
| 76 | ), | 70 | ), |
| 77 | fmt.Sprintf("INSERT INTO manufacture.employee_product_record (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), | 71 | fmt.Sprintf("INSERT INTO manufacture.employee_product_record (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), |
| 78 | //employeeProductRecord.EmployeeProductRecordId, | 72 | //employeeProductRecord.EmployeeProductRecordId, |
| @@ -90,9 +84,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | @@ -90,9 +84,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | ||
| 90 | employeeProductRecord.Version, | 84 | employeeProductRecord.Version, |
| 91 | employeeProductRecord.ProductRecordInfo, | 85 | employeeProductRecord.ProductRecordInfo, |
| 92 | employeeProductRecord.ProductWorker, | 86 | employeeProductRecord.ProductWorker, |
| 93 | - employeeProductRecord.ApproveStatus, | ||
| 94 | - employeeProductRecord.ApproveAt, | ||
| 95 | - employeeProductRecord.ApproveUser, | ||
| 96 | ); err != nil { | 87 | ); err != nil { |
| 97 | return employeeProductRecord, err | 88 | return employeeProductRecord, err |
| 98 | } | 89 | } |
| @@ -114,9 +105,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | @@ -114,9 +105,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | ||
| 114 | &employeeProductRecord.Version, | 105 | &employeeProductRecord.Version, |
| 115 | &employeeProductRecord.ProductRecordInfo, | 106 | &employeeProductRecord.ProductRecordInfo, |
| 116 | &employeeProductRecord.ProductWorker, | 107 | &employeeProductRecord.ProductWorker, |
| 117 | - &employeeProductRecord.ApproveStatus, | ||
| 118 | - &employeeProductRecord.ApproveAt, | ||
| 119 | - &employeeProductRecord.ApproveUser, | ||
| 120 | ), | 108 | ), |
| 121 | fmt.Sprintf("UPDATE manufacture.employee_product_record SET %s WHERE employee_product_record_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), | 109 | fmt.Sprintf("UPDATE manufacture.employee_product_record SET %s WHERE employee_product_record_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), |
| 122 | //employeeProductRecord.EmployeeProductRecordId, | 110 | //employeeProductRecord.EmployeeProductRecordId, |
| @@ -134,9 +122,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | @@ -134,9 +122,6 @@ func (repository *EmployeeProductRecordRepository) Save(employeeProductRecord *d | ||
| 134 | employeeProductRecord.Version, | 122 | employeeProductRecord.Version, |
| 135 | employeeProductRecord.ProductRecordInfo, | 123 | employeeProductRecord.ProductRecordInfo, |
| 136 | employeeProductRecord.ProductWorker, | 124 | employeeProductRecord.ProductWorker, |
| 137 | - employeeProductRecord.ApproveStatus, | ||
| 138 | - employeeProductRecord.ApproveAt, | ||
| 139 | - employeeProductRecord.ApproveUser, | ||
| 140 | employeeProductRecord.Identify(), | 125 | employeeProductRecord.Identify(), |
| 141 | ); err != nil { | 126 | ); err != nil { |
| 142 | return employeeProductRecord, err | 127 | return employeeProductRecord, err |
-
请 注册 或 登录 后发表评论