zhangqian
2024-07-05 7198928294605aea6516fc4f7adba95b2216a974
service/operation.go
@@ -261,7 +261,7 @@
      }
   }
   if len(internalInputDetails) > 0 {
      opTypeId, err := GetTargetOperationTypeIdByOperation(originOperation, constvar.BaseOperationTypeIncoming)
      opTypeId, err := GetTargetOperationTypeIdByWarehouseId(originOperation.ToLocation.WarehouseId, constvar.BaseOperationTypeIncoming)
      if err != nil {
         return err
      }
@@ -434,3 +434,14 @@
   }
   return targetOT.Id, nil
}
func GetTargetOperationTypeIdByWarehouseId(warehouseId int, baseOT constvar.BaseOperationType) (operationTypeId int, err error) {
   if warehouseId == 0 {
      return 0, errors.New("warehouseId miss")
   }
   targetOT, err := models.NewOperationTypeSearch().SetBaseOperationType(baseOT).SetWarehouseId(warehouseId).First()
   if err != nil {
      return 0, err
   }
   return targetOT.Id, nil
}