zhangqian
2023-11-29 528c5a54a9445e53607f5dbe1354c312db9f1fa4
controllers/operation.go
@@ -733,7 +733,7 @@
func AddMoveHistory(operationList []*models.Operation, db *gorm.DB) error {
   var histories []*models.MoveHistory
   operationMap := make(map[string]*models.Operation, len(operationList))
   operationMap := make(map[int]*models.Operation, len(operationList))
   for _, operation := range operationList {
      for _, v := range operation.Details {
         history := &models.MoveHistory{
@@ -754,13 +754,13 @@
         }
         histories = append(histories, history)
      }
      operationMap[operation.Number] = operation
      operationMap[operation.Id] = operation
   }
   if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil {
      return err
   }
   for _, history := range histories {
      service.AddNewHistoryReportRecord(history, operationMap[history.Number])
      service.AddNewHistoryReportRecord(history, operationMap[history.OperationId])
   }
   return nil
}